Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
65fc0d0f
Commit
65fc0d0f
authored
Dec 17, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure request.auth is available to response middleware.
parent
7fbf5b0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
rest_framework/request.py
+6
-4
No files found.
rest_framework/request.py
View file @
65fc0d0f
...
...
@@ -278,7 +278,8 @@ class Request(object):
compatibility with django.contrib.auth where the user property is
set in the login and logout functions.
Sets the user on the wrapped original request as well.
Note that we also set the user on Django's underlying `HttpRequest`
instance, ensuring that it is available to any middleware in the stack.
"""
self
.
_user
=
value
self
.
_request
.
user
=
value
...
...
@@ -300,6 +301,7 @@ class Request(object):
request, such as an authentication token.
"""
self
.
_auth
=
value
self
.
_request
.
auth
=
value
@property
def
successful_authenticator
(
self
):
...
...
@@ -459,7 +461,7 @@ class Request(object):
if
user_auth_tuple
is
not
None
:
self
.
_authenticator
=
authenticator
self
.
user
,
self
.
_
auth
=
user_auth_tuple
self
.
user
,
self
.
auth
=
user_auth_tuple
return
self
.
_not_authenticated
()
...
...
@@ -479,9 +481,9 @@ class Request(object):
self
.
user
=
None
if
api_settings
.
UNAUTHENTICATED_TOKEN
:
self
.
_
auth
=
api_settings
.
UNAUTHENTICATED_TOKEN
()
self
.
auth
=
api_settings
.
UNAUTHENTICATED_TOKEN
()
else
:
self
.
_
auth
=
None
self
.
auth
=
None
def
__getattr__
(
self
,
attr
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment