mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
use error messages instead of a fixed string
This commit is contained in:
parent
809e17d487
commit
246cd5455f
|
@ -274,7 +274,7 @@ class BaseSerializer(WritableField):
|
|||
reverted_data = {}
|
||||
|
||||
if data is not None and not isinstance(data, dict):
|
||||
self._errors['non_field_errors'] = ['Invalid data']
|
||||
self._errors['non_field_errors'] = [self.error_messages['invalid_data']]
|
||||
return None
|
||||
|
||||
for field_name, field in self.fields.items():
|
||||
|
|
Loading…
Reference in New Issue
Block a user