aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authentication.py
diff options
context:
space:
mode:
authorEthan Fremen2013-06-10 10:29:25 -0700
committerEthan Fremen2013-06-10 10:29:25 -0700
commit0e75bcd2592caa8862e0b0166a6b851a3eada749 (patch)
tree4be625563775f1cab06219d3a7a5a62c0ff74bfd /rest_framework/authentication.py
parentde00ec95c3007dd90b5b01f7486b430699ea63c1 (diff)
parent5d0aeef69ecec70242513195c19edcb622e14371 (diff)
downloaddjango-rest-framework-0e75bcd2592caa8862e0b0166a6b851a3eada749.tar.bz2
Merge remote-tracking branch 'upstream/master' into writable-nested-modelserializer
Diffstat (limited to 'rest_framework/authentication.py')
-rw-r--r--rest_framework/authentication.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py
index 9caca788..f659a172 100644
--- a/rest_framework/authentication.py
+++ b/rest_framework/authentication.py
@@ -230,8 +230,9 @@ class OAuthAuthentication(BaseAuthentication):
try:
consumer_key = oauth_request.get_parameter('oauth_consumer_key')
consumer = oauth_provider_store.get_consumer(request, oauth_request, consumer_key)
- except oauth_provider.store.InvalidConsumerError as err:
- raise exceptions.AuthenticationFailed(err)
+ except oauth_provider.store.InvalidConsumerError:
+ msg = 'Invalid consumer token: %s' % oauth_request.get_parameter('oauth_consumer_key')
+ raise exceptions.AuthenticationFailed(msg)
if consumer.status != oauth_provider.consts.ACCEPTED:
msg = 'Invalid consumer key status: %s' % consumer.get_status_display()