aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/fields.py
diff options
context:
space:
mode:
authorTom Christie2014-11-25 11:14:28 +0000
committerTom Christie2014-11-25 11:14:28 +0000
commit06fd63dade20e1a19276b7414a54b9f5d2ef8329 (patch)
tree503f2e2828d6ed0f353f2a27b40ed92454d766ad /rest_framework/fields.py
parent17c7431a6d629cc284b1417c60811cbdf154ce62 (diff)
downloaddjango-rest-framework-06fd63dade20e1a19276b7414a54b9f5d2ef8329.tar.bz2
Don't use default_empty_html value for partial updates. Closes #2118.
Diffstat (limited to 'rest_framework/fields.py')
-rw-r--r--rest_framework/fields.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py
index 778bc718..3cf34886 100644
--- a/rest_framework/fields.py
+++ b/rest_framework/fields.py
@@ -262,7 +262,11 @@ class Field(object):
if html.is_html_input(dictionary):
# HTML forms will represent empty fields as '', and cannot
# 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 dictionary.get(self.field_name, empty)