mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-18 12:30:58 +03:00
Fix for #2894 thanks to @carljm
This commit is contained in:
parent
94e2d3ca61
commit
5c90bf9cc0
|
@ -1060,7 +1060,11 @@ class MultipleChoiceField(ChoiceField):
|
||||||
# We override the default field access in order to support
|
# We override the default field access in order to support
|
||||||
# lists in HTML forms.
|
# lists in HTML forms.
|
||||||
if html.is_html_input(dictionary):
|
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)
|
return dictionary.get(self.field_name, empty)
|
||||||
|
|
||||||
def to_internal_value(self, data):
|
def to_internal_value(self, data):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user