X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0e87ae0739ed3e72301b7b718098f97a7f06a5d8..5666068eebddee003f4d0e8e7ffeb1bb98f40d00:/apps/piston/store.py?ds=sidebyside diff --git a/apps/piston/store.py b/apps/piston/store.py index 787791ab8..13377d6a9 100644 --- a/apps/piston/store.py +++ b/apps/piston/store.py @@ -23,7 +23,7 @@ class DataStore(oauth.OAuthDataStore): 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: @@ -32,7 +32,7 @@ class DataStore(oauth.OAuthDataStore): 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: @@ -45,10 +45,10 @@ class DataStore(oauth.OAuthDataStore): 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