From 4055129662023a13c40ccea108a990b818d244cd Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 22 Mar 2013 21:31:32 +0000 Subject: [PATCH] If oauth is not attempted don't throw an error. Fixes #748. --- rest_framework/authentication.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index b4b73699e..8f4ec536e 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)