aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/authentication.py
diff options
context:
space:
mode:
authorTom Christie2013-03-22 21:31:32 +0000
committerTom Christie2013-03-22 21:31:50 +0000
commit4055129662023a13c40ccea108a990b818d244cd (patch)
tree4e497dad0ff1f0bfdfdc49962eb396cb32647e99 /rest_framework/authentication.py
parent6770a5bbafb13a8699e6d459e5cfc4eba0ffdf64 (diff)
downloaddjango-rest-framework-4055129662023a13c40ccea108a990b818d244cd.tar.bz2
If oauth is not attempted don't throw an error. Fixes #748.
Diffstat (limited to 'rest_framework/authentication.py')
-rw-r--r--rest_framework/authentication.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py
index b4b73699..8f4ec536 100644
--- a/rest_framework/authentication.py
+++ b/rest_framework/authentication.py
@@ -204,6 +204,9 @@ class OAuthAuthentication(BaseAuthentication):
except oauth.Error as err:
raise exceptions.AuthenticationFailed(err.message)
+ if not oauth_request:
+ return None
+
oauth_params = oauth_provider.consts.OAUTH_PARAMETERS_NAMES
found = any(param for param in oauth_params if param in oauth_request)