mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
DictField returns empty value if no data was specified in a form request
This commit is contained in:
parent
99fb424586
commit
0577a75d47
|
@ -1711,7 +1711,7 @@ class DictField(Field):
|
||||||
# We override the default field access in order to support
|
# We override the default field access in order to support
|
||||||
# dictionaries in HTML forms.
|
# dictionaries in HTML forms.
|
||||||
if html.is_html_input(dictionary):
|
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)
|
return dictionary.get(self.field_name, empty)
|
||||||
|
|
||||||
def to_internal_value(self, data):
|
def to_internal_value(self, data):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user