Fixed ListField validation for POST request with content-type form-data.

This commit is contained in:
Bogdan 2017-05-25 12:19:24 +03:00
parent 871ce34983
commit 939af5f4e3

View File

@ -1551,7 +1551,8 @@ class ListField(Field):
if len(val) > 0: if len(val) > 0:
# Support QueryDict lists in HTML input. # Support QueryDict lists in HTML input.
return val return val
return html.parse_html_list(dictionary, prefix=self.field_name) parsed_list = html.parse_html_list(dictionary, prefix=self.field_name)
return parsed_list if parsed_list else empty
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):