Skip to content

Commit d6bff10

Browse files
committed
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
1 parent 605c1fa commit d6bff10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/parsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def parse(self, stream, media_type=None, parser_context=None):
277277
for index, handler in enumerate(upload_handlers):
278278
file_obj = handler.file_complete(counters[index])
279279
if file_obj:
280-
return DataAndFiles(None, {'file': file_obj})
280+
return DataAndFiles({}, {'file': file_obj})
281281
raise ParseError("FileUpload parse error - "
282282
"none of upload handlers can handle the stream")
283283

0 commit comments

Comments
 (0)