diff options
| author | Tom Christie | 2013-08-29 21:24:29 +0100 | 
|---|---|---|
| committer | Tom Christie | 2013-08-29 21:24:29 +0100 | 
| commit | 2247fd68e9b3bbc91075a11f44db16fc40497b2a (patch) | |
| tree | 5ef2eede00beb093f987070fe5391266fcd39f15 /rest_framework/parsers.py | |
| parent | 19f9adacb254841d02f43295baf81406ce3c60eb (diff) | |
| download | django-rest-framework-2247fd68e9b3bbc91075a11f44db16fc40497b2a.tar.bz2 | |
Fix multipart error when used via content-type overloading
Diffstat (limited to 'rest_framework/parsers.py')
| -rw-r--r-- | rest_framework/parsers.py | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index 23387dff..98fc0341 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -122,7 +122,8 @@ class MultiPartParser(BaseParser):          parser_context = parser_context or {}          request = parser_context['request']          encoding = parser_context.get('encoding', settings.DEFAULT_CHARSET) -        meta = request.META +        meta = request.META.copy() +        meta['CONTENT_TYPE'] = media_type          upload_handlers = request.upload_handlers          try: @@ -130,7 +131,7 @@ class MultiPartParser(BaseParser):              data, files = parser.parse()              return DataAndFiles(data, files)          except MultiPartParserError as exc: -            raise ParseError('Multipart form parse error - %s' % six.u(exc.strerror)) +            raise ParseError('Multipart form parse error - %s' % str(exc))  class XMLParser(BaseParser): | 
