From d6bff10f9829b3cef1c2773c303b172a8c7ec525 Mon Sep 17 00:00:00 2001 From: Ask Holme Date: Sat, 10 Jan 2015 18:15:21 +0100 Subject: [PATCH] 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 --- rest_framework/parsers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index 3e3395c0c..401856ec4 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -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")