Skip to content

Commit bfdf795

Browse files
committed
Merge pull request encode#3592 from tomchristie/request-parsing-when-post-accessed
Request parsing when .POST accessed
2 parents 950e5e0 + d587ad1 commit bfdf795

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

docs/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ General guides to using REST framework.
204204
* [3.2 Announcement][3.2-announcement]
205205
* [3.3 Announcement][3.3-announcement]
206206
* [Kickstarter Announcement][kickstarter-announcement]
207-
* [Funding][funding]
208207
* [Release Notes][release-notes]
209208

210209
## Development

docs/topics/3.3-announcement.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The 3.3 release marks the final work in the Kickstarter funded series. We'd like
44

55
The amount of work that has been achieved as a direct result of the funding is immense. We've added a huge amounts of new functionality, resolved nearly 2,000 tickets, and redesigned & refined large parts of the project.
66

7-
In order to continue driving REST framework forward, we're introducing [monthly paid plans](https://fund.django-rest-framework.org/topics/funding). These plans include various sponsorship rewards, and will ensure that the project remains sustainable and well supported.
7+
In order to continue driving REST framework forward, we'll shortly be announcing a new set of funding plans. Follow [@_tomchristie](https://twitter.com/_tomchristie) to keep up to date with these announcements, and be among the first set of sign ups.
88

99
We strongly believe that collaboratively funded software development yields outstanding results for a relatively low investment-per-head. If you or your company use REST framework commercially, then we would strongly urge you to participate in this latest funding drive, and help us continue to build an increasingly polished & professional product.
1010

docs/topics/release-notes.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You can determine your currently installed version using `pip freeze`:
4242

4343
### 3.3.0
4444

45-
**Date**: [27th October 2015][3.3.0-milestone]
45+
**Date**: [28th October 2015][3.3.0-milestone].
4646

4747
* HTML controls for filters. ([#3315][gh3315])
4848
* Forms API. ([#3475][gh3475])
@@ -58,11 +58,17 @@ You can determine your currently installed version using `pip freeze`:
5858

5959
## 3.2.x series
6060

61+
### 3.2.5
62+
63+
**Date**: [27th October 2015][3.2.5-milestone].
64+
65+
* Escape `username` in optional logout tag. ([#3550][gh3550])
66+
6167
### 3.2.4
6268

6369
**Date**: [21th September 2015][3.2.4-milestone].
6470

65-
* Don't error on missing `ViewSet.search_fields` attribute.([#3324][gh3324], [#3323][gh3323])
71+
* Don't error on missing `ViewSet.search_fields` attribute. ([#3324][gh3324], [#3323][gh3323])
6672
* Fix `allow_empty` not working on serializers with `many=True`. ([#3361][gh3361], [#3364][gh3364])
6773
* Let `DurationField` accepts integers. ([#3359][gh3359])
6874
* Multi-level dictionaries not supported in multipart requests. ([#3314][gh3314])
@@ -328,6 +334,8 @@ For older release notes, [please see the version 2.x documentation][old-release-
328334
[3.2.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.2+Release%22
329335
[3.2.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.3+Release%22
330336
[3.2.4-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.4+Release%22
337+
[3.2.5-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.5+Release%22
338+
[3.3.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.3.0+Release%22
331339

332340
<!-- 3.0.1 -->
333341
[gh2013]: https://github.com/tomchristie/django-rest-framework/issues/2013
@@ -552,6 +560,9 @@ For older release notes, [please see the version 2.x documentation][old-release-
552560
[gh3364]: https://github.com/tomchristie/django-rest-framework/issues/3364
553561
[gh3415]: https://github.com/tomchristie/django-rest-framework/issues/3415
554562

563+
<!-- 3.2.5 -->
564+
[gh3550]:https://github.com/tomchristie/django-rest-framework/issues/3550
565+
555566
<!-- 3.3.0 -->
556567
[gh3315]: https://github.com/tomchristie/django-rest-framework/issues/3315
557568
[gh3410]: https://github.com/tomchristie/django-rest-framework/issues/3410

mkdocs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,4 @@ pages:
6363
- '3.2 Announcement': 'topics/3.2-announcement.md'
6464
- '3.3 Announcement': 'topics/3.3-announcement.md'
6565
- 'Kickstarter Announcement': 'topics/kickstarter-announcement.md'
66-
- 'Funding': 'topics/funding.md'
6766
- 'Release Notes': 'topics/release-notes.md'

rest_framework/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
__title__ = 'Django REST framework'
11-
__version__ = '3.2.4'
11+
__version__ = '3.3.0'
1212
__author__ = 'Tom Christie'
1313
__license__ = 'BSD 2-Clause'
1414
__copyright__ = 'Copyright 2011-2015 Tom Christie'

rest_framework/authentication.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ def authenticate(self, request):
117117
Otherwise returns `None`.
118118
"""
119119

120-
# Get the underlying HttpRequest object
121-
request = request._request
122-
user = getattr(request, 'user', None)
120+
# Get the session-based user from the underlying HttpRequest object
121+
user = getattr(request._request, 'user', None)
123122

124123
# Unauthenticated, CSRF validation not required
125124
if not user or not user.is_active:

rest_framework/request.py

+9
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,15 @@ def DATA(self):
365365
'since version 3.0, and has been fully removed as of version 3.2.'
366366
)
367367

368+
@property
369+
def POST(self):
370+
# Ensure that request.POST uses our request parsing.
371+
if not _hasattr(self, '_data'):
372+
self._load_data_and_files()
373+
if is_form_media_type(self.content_type):
374+
return self.data
375+
return QueryDict('', encoding=self._request._encoding)
376+
368377
@property
369378
def FILES(self):
370379
# Leave this one alone for backwards compat with Django's request.FILES

0 commit comments

Comments
 (0)