aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/relations.py
diff options
context:
space:
mode:
authorTom Christie2015-01-30 14:00:25 +0000
committerTom Christie2015-01-30 14:00:25 +0000
commit4ee4b4f2dc3cffd8246772bdf829a2a720493377 (patch)
tree95b514483e901c10bdeee0d66e60430002d5101a /rest_framework/relations.py
parent8f33e39f62c59d06783dd3e6e7cf8d464ff08c5f (diff)
parent7cf9dea7f905ea6869148a68b4fa96cad0a347e8 (diff)
downloaddjango-rest-framework-4ee4b4f2dc3cffd8246772bdf829a2a720493377.tar.bz2
Merge master
Diffstat (limited to 'rest_framework/relations.py')
-rw-r--r--rest_framework/relations.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rest_framework/relations.py b/rest_framework/relations.py
index a85edfec..66857a41 100644
--- a/rest_framework/relations.py
+++ b/rest_framework/relations.py
@@ -338,7 +338,12 @@ class ManyRelatedField(Field):
# We override the default field access in order to support
# lists in HTML forms.
if html.is_html_input(dictionary):
+ # Don't return [] if the update is partial
+ if self.field_name not in dictionary:
+ if getattr(self.root, 'partial', False):
+ return empty
return dictionary.getlist(self.field_name)
+
return dictionary.get(self.field_name, empty)
def to_internal_value(self, data):