Make FileUploadParser work with standard django API

Output from parsers ends up in a Django MergeDict and they exists elements to be dicts - not None
This commit is contained in:
Ask Holme 2015-01-10 18:15:21 +01:00
parent 605c1fa0a8
commit d6bff10f98

View File

@ -277,7 +277,7 @@ class FileUploadParser(BaseParser):
for index, handler in enumerate(upload_handlers):
file_obj = handler.file_complete(counters[index])
if file_obj:
return DataAndFiles(None, {'file': file_obj})
return DataAndFiles({}, {'file': file_obj})
raise ParseError("FileUpload parse error - "
"none of upload handlers can handle the stream")