Fix for #2894 thanks to @carljm

This commit is contained in:
Xavier Ordoquy 2015-06-01 16:13:35 +01:00
parent 94e2d3ca61
commit 5c90bf9cc0

View File

@ -1060,7 +1060,11 @@ class MultipleChoiceField(ChoiceField):
# We override the default field access in order to support
# lists in HTML forms.
if html.is_html_input(dictionary):
return dictionary.getlist(self.field_name)
ret = dictionary.getlist(self.field_name)
if getattr(self.root, 'partial', False) and not ret:
ret = empty
return ret
return dictionary.get(self.field_name, empty)
def to_internal_value(self, data):