diff options
| author | Tom Christie | 2013-02-14 13:02:28 +0000 | 
|---|---|---|
| committer | Tom Christie | 2013-02-14 13:02:28 +0000 | 
| commit | af686ec11a267183e84d8e59dca7d4ee1f05dedd (patch) | |
| tree | df09c6da872b1c84f912309de2f6247be906ad14 /rest_framework/request.py | |
| parent | 9d3153ed04aed78a977e064d0715baaf178ff88a (diff) | |
| download | django-rest-framework-af686ec11a267183e84d8e59dca7d4ee1f05dedd.tar.bz2 | |
request.DATA should use empty QueryDict for no data, not None.
Diffstat (limited to 'rest_framework/request.py')
| -rw-r--r-- | rest_framework/request.py | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/rest_framework/request.py b/rest_framework/request.py index bde391f9..3e2fbd88 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -11,7 +11,9 @@ The wrapped request then offers a richer API, in particular :  """  from __future__ import unicode_literals  from django.conf import settings +from django.http import QueryDict  from django.http.multipartparser import parse_header +from django.utils.datastructures import MultiValueDict  from rest_framework import HTTP_HEADER_ENCODING  from rest_framework import exceptions  from rest_framework.compat import BytesIO @@ -297,7 +299,9 @@ class Request(object):          media_type = self.content_type          if stream is None or media_type is None: -            return (None, None) +            empty_data = QueryDict('', self._request._encoding) +            empty_files = MultiValueDict() +            return (empty_data, empty_files)          parser = self.negotiator.select_parser(self, self.parsers) @@ -311,7 +315,8 @@ class Request(object):          try:              return (parsed.data, parsed.files)          except AttributeError: -            return (parsed, None) +            empty_files = MultiValueDict() +            return (parsed, empty_files)      def _authenticate(self):          """ | 
