aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/request.py
diff options
context:
space:
mode:
authorTom Christie2013-01-07 21:04:52 +0000
committerTom Christie2013-01-07 21:04:52 +0000
commit36fa722ebb1b438b710b90fe470fbdbf82fd676e (patch)
tree9a837478ff46ebeed0b03fe9a430d72695cc2784 /rest_framework/request.py
parent873a142af2f63084fd10bf35c13e79131837da07 (diff)
parente429f702e00ed807d68e90cd6a6af2749eb0b73e (diff)
downloaddjango-rest-framework-36fa722ebb1b438b710b90fe470fbdbf82fd676e.tar.bz2
Merged to latest master
Diffstat (limited to 'rest_framework/request.py')
-rw-r--r--rest_framework/request.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/rest_framework/request.py b/rest_framework/request.py
index 38ee36dd..1c28cd17 100644
--- a/rest_framework/request.py
+++ b/rest_framework/request.py
@@ -170,6 +170,15 @@ class Request(object):
self._authenticator, self._user, self._auth = self._authenticate()
return self._user
+ @user.setter
+ def user(self, value):
+ """
+ Sets the user on the current request. This is necessary to maintain
+ compatilbility with django.contrib.auth where the user proprety is
+ set in the login and logout functions.
+ """
+ self._user = value
+
@property
def auth(self):
"""
@@ -180,6 +189,14 @@ class Request(object):
self._authenticator, self._user, self._auth = self._authenticate()
return self._auth
+ @auth.setter
+ def auth(self, value):
+ """
+ Sets any non-user authentication information associated with the
+ request, such as an authentication token.
+ """
+ self._auth = value
+
@property
def successful_authenticator(self):
"""