Make sure that ListFields are not strings
This commit is contained in:
parent
1a2c74391c
commit
9b4d0f6450
1 changed files with 2 additions and 1 deletions
|
|
@ -472,7 +472,8 @@ class ListField(ComplexBaseField):
|
|||
def validate(self, value):
|
||||
"""Make sure that a list of valid fields is being used.
|
||||
"""
|
||||
if not isinstance(value, (list, tuple)):
|
||||
if (not isinstance(value, (list, tuple)) or
|
||||
isinstance(value, basestring)):
|
||||
raise ValidationError('Only lists and tuples may be used in a '
|
||||
'list field')
|
||||
super(ListField, self).validate(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue