elif token_type == 'access':
token_type = Token.ACCESS
try:
- self.request_token = Token.objects.get(key=token,
+ self.request_token = Token.objects.get(key=token,
token_type=token_type)
return self.request_token
except Token.DoesNotExist:
def lookup_nonce(self, oauth_consumer, oauth_token, nonce):
if oauth_token is None:
return None
- nonce, created = Nonce.objects.get_or_create(consumer_key=oauth_consumer.key,
+ nonce, created = Nonce.objects.get_or_create(consumer_key=oauth_consumer.key,
token_key=oauth_token.key,
key=nonce)
if created:
self.request_token = Token.objects.create_token(consumer=self.consumer,
token_type=Token.REQUEST,
timestamp=self.timestamp)
-
+
if oauth_callback:
self.request_token.set_callback(oauth_callback)
-
+
return self.request_token
return None