Skip to content

Commit 06fd63d

Browse files
committed
Don't use default_empty_html value for partial updates. Closes #2118.
1 parent 17c7431 commit 06fd63d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rest_framework/fields.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ def get_value(self, dictionary):
262262
if html.is_html_input(dictionary):
263263
# HTML forms will represent empty fields as '', and cannot
264264
# represent None or False values directly.
265-
ret = dictionary.get(self.field_name, '')
265+
if self.field_name not in dictionary:
266+
if getattr(self.root, 'partial', False):
267+
return empty
268+
return self.default_empty_html
269+
ret = dictionary[self.field_name]
266270
return self.default_empty_html if (ret == '') else ret
267271
return dictionary.get(self.field_name, empty)
268272

0 commit comments

Comments
 (0)