mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
serializers: fix ListSerializer.get_value
It should return `empty` for non present field on partial updates when using HTML input.
This commit is contained in:
parent
ebb4070467
commit
0d32406445
|
@ -545,6 +545,10 @@ class ListSerializer(BaseSerializer):
|
|||
# We override the default field access in order to support
|
||||
# lists in HTML forms.
|
||||
if html.is_html_input(dictionary):
|
||||
if self.field_name not in dictionary:
|
||||
if getattr(self.root, 'partial', False):
|
||||
return empty
|
||||
|
||||
return html.parse_html_list(dictionary, prefix=self.field_name)
|
||||
return dictionary.get(self.field_name, empty)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user