From 0577a75d4748525ccf66aea2dc1346f5e7236398 Mon Sep 17 00:00:00 2001 From: Brett Lempereur Date: Sun, 7 Oct 2018 17:50:58 +0100 Subject: [PATCH] DictField returns empty value if no data was specified in a form request --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 70c210c16..b84bca015 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1711,7 +1711,7 @@ class DictField(Field): # We override the default field access in order to support # dictionaries in HTML forms. if html.is_html_input(dictionary): - return html.parse_html_dict(dictionary, prefix=self.field_name) + return html.parse_html_dict(dictionary, prefix=self.field_name, default=empty) return dictionary.get(self.field_name, empty) def to_internal_value(self, data):