mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #22799 -- Made GET and POST on HttpRequest QueryDicts, and FILES a MultiValueDict.
Previously, GET, POST, and FILES on an HttpRequest were created in the __init__ method as dictionaries. This was not something you would usually notice causing trouble in production as you'd only see a WSGIRequest, but in testing using the test client, calling .getlist on GET, POST, or FILES for a request with no get/post data resulted in an AttributeError. Changed GET and POST on an HttpRequest object to be mutable QueryDicts (mutable because the Django tests, and probably many third party tests, were expecting it).
This commit is contained in:
committed by
Tim Graham
parent
d68987ae25
commit
fd4ccd045c
@@ -220,6 +220,12 @@ Requests and Responses
|
||||
instantiated with ``QueryDict()`` instead of ``QueryDict(None)`` or
|
||||
``QueryDict('')``.
|
||||
|
||||
* The ``GET`` and ``POST`` attributes of an :class:`~django.http.HttpRequest`
|
||||
object are now :class:`~django.http.QueryDict`\s rather than dictionaries,
|
||||
and the ``FILES`` attribute is now a ``MultiValueDict``.
|
||||
This brings this class into line with the documentation and with
|
||||
``WSGIRequest``.
|
||||
|
||||
Tests
|
||||
^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user