aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/authenticators.py
diff options
context:
space:
mode:
Diffstat (limited to 'djangorestframework/authenticators.py')
-rw-r--r--djangorestframework/authenticators.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/djangorestframework/authenticators.py b/djangorestframework/authenticators.py
index 8de182de..24addb22 100644
--- a/djangorestframework/authenticators.py
+++ b/djangorestframework/authenticators.py
@@ -38,7 +38,7 @@ class BasicAuthenticator(BaseAuthenticator):
class UserLoggedInAuthenticator(BaseAuthenticator):
"""Use Djagno's built-in request session for authentication."""
def authenticate(self, request):
- if request.user and request.user.is_active:
+ if getattr(request, 'user', None) and request.user.is_active:
return request.user
return None