Commit cb202161 by Tom Christie

Merge pull request #776 from atlefren/master

Proper import of errors from oauth_provider
parents a18d3df0 80d28de0
...@@ -230,7 +230,7 @@ class OAuthAuthentication(BaseAuthentication): ...@@ -230,7 +230,7 @@ class OAuthAuthentication(BaseAuthentication):
try: try:
consumer_key = oauth_request.get_parameter('oauth_consumer_key') consumer_key = oauth_request.get_parameter('oauth_consumer_key')
consumer = oauth_provider_store.get_consumer(request, oauth_request, consumer_key) consumer = oauth_provider_store.get_consumer(request, oauth_request, consumer_key)
except oauth_provider_store.InvalidConsumerError as err: except oauth_provider.store.InvalidConsumerError as err:
raise exceptions.AuthenticationFailed(err) raise exceptions.AuthenticationFailed(err)
if consumer.status != oauth_provider.consts.ACCEPTED: if consumer.status != oauth_provider.consts.ACCEPTED:
...@@ -240,7 +240,7 @@ class OAuthAuthentication(BaseAuthentication): ...@@ -240,7 +240,7 @@ class OAuthAuthentication(BaseAuthentication):
try: try:
token_param = oauth_request.get_parameter('oauth_token') token_param = oauth_request.get_parameter('oauth_token')
token = oauth_provider_store.get_access_token(request, oauth_request, consumer, token_param) token = oauth_provider_store.get_access_token(request, oauth_request, consumer, token_param)
except oauth_provider_store.InvalidTokenError: except oauth_provider.store.InvalidTokenError:
msg = 'Invalid access token: %s' % oauth_request.get_parameter('oauth_token') msg = 'Invalid access token: %s' % oauth_request.get_parameter('oauth_token')
raise exceptions.AuthenticationFailed(msg) raise exceptions.AuthenticationFailed(msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment