mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
self._errors might be None when nesting serializers
This commit is contained in:
parent
a8622adcd9
commit
8956845077
|
@ -272,6 +272,7 @@ class BaseSerializer(WritableField):
|
||||||
Converts a dictionary of data into a dictionary of deserialized fields.
|
Converts a dictionary of data into a dictionary of deserialized fields.
|
||||||
"""
|
"""
|
||||||
reverted_data = {}
|
reverted_data = {}
|
||||||
|
self._errors = self._errors or {}
|
||||||
|
|
||||||
if data is not None and not isinstance(data, dict):
|
if data is not None and not isinstance(data, dict):
|
||||||
self._errors['non_field_errors'] = ['Invalid data']
|
self._errors['non_field_errors'] = ['Invalid data']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user