mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Don't use default_empty_html value for partial updates. Closes #2118.
This commit is contained in:
parent
17c7431a6d
commit
06fd63dade
|
@ -262,7 +262,11 @@ class Field(object):
|
||||||
if html.is_html_input(dictionary):
|
if html.is_html_input(dictionary):
|
||||||
# HTML forms will represent empty fields as '', and cannot
|
# HTML forms will represent empty fields as '', and cannot
|
||||||
# represent None or False values directly.
|
# represent None or False values directly.
|
||||||
ret = dictionary.get(self.field_name, '')
|
if self.field_name not in dictionary:
|
||||||
|
if getattr(self.root, 'partial', False):
|
||||||
|
return empty
|
||||||
|
return self.default_empty_html
|
||||||
|
ret = dictionary[self.field_name]
|
||||||
return self.default_empty_html if (ret == '') else ret
|
return self.default_empty_html if (ret == '') else ret
|
||||||
return dictionary.get(self.field_name, empty)
|
return dictionary.get(self.field_name, empty)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user