aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authentication.py
diff options
context:
space:
mode:
authorTom Christie2013-06-13 00:10:23 -0700
committerTom Christie2013-06-13 00:10:23 -0700
commit170709442bb3f53bd2b49414cdff0495e7d6c9eb (patch)
tree2168c40e527b3ff9cc54fbd14fdb823799bbf280 /rest_framework/authentication.py
parentde00ec95c3007dd90b5b01f7486b430699ea63c1 (diff)
parent2ed79b6dc626cb2fcc1bfc119ef5757c590bb983 (diff)
downloaddjango-rest-framework-170709442bb3f53bd2b49414cdff0495e7d6c9eb.tar.bz2
Merge pull request #931 from mindlace-mp/writable-nested-modelserializer
Merged 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()