You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if self._errors and raise_exception:
> raise ValidationError(self.errors)
E rest_framework.exceptions.ValidationError: [{'choices': ['This field is required.']}]
Actual behavior
self = TheSerializer(data=[{'name': 'hhj'}], many=True):
name = CharField(required=True)
choices = CharField(required=True)
@property
def errors(self):
ret = super(ListSerializer, self).errors
> if isinstance(ret, list) and len(ret) == 1 and ret[0].code == 'null':
E AttributeError: 'dict' object has no attribute 'code'
The text was updated successfully, but these errors were encountered:
There is a bug when validating only one object with a list serializer with raise_exception flag set as True.
It worked just fine in 3.4.7.
Steps to reproduce
Here is the class that will cause the issue
Then run
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: