diff options
| author | Tom Christie | 2012-12-02 06:59:27 -0800 |
|---|---|---|
| committer | Tom Christie | 2012-12-02 06:59:27 -0800 |
| commit | 56bb4a5b032f4d19beb9e97fe3ca40440d39dff0 (patch) | |
| tree | 940a641a0af92418b6c525d31faa123266ac1119 /rest_framework/request.py | |
| parent | 3114b4fa50e7aee296a0de17e7bcdc0753700ec3 (diff) | |
| parent | 85a921c7efcea50a5d594082f0e4ddeefd95402f (diff) | |
| download | django-rest-framework-56bb4a5b032f4d19beb9e97fe3ca40440d39dff0.tar.bz2 | |
Merge pull request #448 from mhsparks/master
Add setter to user property on request object
Diffstat (limited to 'rest_framework/request.py')
| -rw-r--r-- | rest_framework/request.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rest_framework/request.py b/rest_framework/request.py index a1827ba4..39c64321 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -169,6 +169,15 @@ class Request(object): 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): """ |
