Fix multipart error when used via content-type overloading

This commit is contained in:
Tom Christie 2013-08-29 21:24:29 +01:00
parent 19f9adacb2
commit 2247fd68e9

View File

@ -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):