mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Require that data is a list.
This commit is contained in:
parent
c94b354efa
commit
f808f08a0d
|
@ -1461,7 +1461,7 @@ class ListField(Field):
|
|||
"""
|
||||
if html.is_html_input(data):
|
||||
data = html.parse_html_list(data)
|
||||
if isinstance(data, type('')) or not hasattr(data, '__iter__'):
|
||||
if not isinstance(data, list):
|
||||
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