From 7f46251f7d2ddfb1d7a997d88ae320bc0361a0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Andr=C3=A9s=20Angulo?= Date: Wed, 18 Jul 2012 20:06:10 -0500 Subject: [PATCH] Added the user in the request for BasicAuthentication, this allow the use of request.user in the views --- djangorestframework/authentication.py | 1 + 1 file changed, 1 insertion(+) diff --git a/djangorestframework/authentication.py b/djangorestframework/authentication.py index f46a9c460..f2558e22e 100644 --- a/djangorestframework/authentication.py +++ b/djangorestframework/authentication.py @@ -73,6 +73,7 @@ class BasicAuthentication(BaseAuthentication): user = authenticate(username=uname, password=passwd) if user is not None and user.is_active: + request.user = user return user return None