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
d587ad10
Commit
d587ad10
authored
Nov 04, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use REST framework request parsing when accessing old-style .POST
parent
bb555e6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
rest_framework/authentication.py
+2
-3
rest_framework/request.py
+9
-0
No files found.
rest_framework/authentication.py
View file @
d587ad10
...
@@ -117,9 +117,8 @@ class SessionAuthentication(BaseAuthentication):
...
@@ -117,9 +117,8 @@ class SessionAuthentication(BaseAuthentication):
Otherwise returns `None`.
Otherwise returns `None`.
"""
"""
# Get the underlying HttpRequest object
# Get the session-based user from the underlying HttpRequest object
request
=
request
.
_request
user
=
getattr
(
request
.
_request
,
'user'
,
None
)
user
=
getattr
(
request
,
'user'
,
None
)
# Unauthenticated, CSRF validation not required
# Unauthenticated, CSRF validation not required
if
not
user
or
not
user
.
is_active
:
if
not
user
or
not
user
.
is_active
:
...
...
rest_framework/request.py
View file @
d587ad10
...
@@ -366,6 +366,15 @@ class Request(object):
...
@@ -366,6 +366,15 @@ class Request(object):
)
)
@property
@property
def
POST
(
self
):
# Ensure that request.POST uses our request parsing.
if
not
_hasattr
(
self
,
'_data'
):
self
.
_load_data_and_files
()
if
is_form_media_type
(
self
.
content_type
):
return
self
.
data
return
QueryDict
(
''
,
encoding
=
self
.
_request
.
_encoding
)
@property
def
FILES
(
self
):
def
FILES
(
self
):
# Leave this one alone for backwards compat with Django's request.FILES
# Leave this one alone for backwards compat with Django's request.FILES
# Different from the other two cases, which are not valid property
# Different from the other two cases, which are not valid property
...
...
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