mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
Exclude collections.Mapping from allowable data types in ListField
This commit is contained in:
parent
dac1637bb3
commit
8fa7c5c914
|
@ -1461,7 +1461,7 @@ class ListField(Field):
|
|||
"""
|
||||
if html.is_html_input(data):
|
||||
data = html.parse_html_list(data)
|
||||
if not isinstance(data, (list, tuple, set)):
|
||||
if isinstance(data, type('')) or isinstance(data, collections.Mapping) or not hasattr(data, '__iter__'):
|
||||
self.fail('not_a_list', input_type=type(data).__name__)
|
||||
if not self.allow_empty and len(data) == 0:
|
||||
self.fail('empty')
|
||||
|
|
Loading…
Reference in New Issue
Block a user