mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Merge a2d5a07ae7
into 650a91ac24
This commit is contained in:
commit
aa4fe0799b
|
@ -260,6 +260,7 @@ class WritableField(Field):
|
|||
default_error_messages = {
|
||||
'required': _('This field is required.'),
|
||||
'invalid': _('Invalid value.'),
|
||||
'invalid_data': _('Invalid data.'),
|
||||
}
|
||||
widget = widgets.TextInput
|
||||
default = None
|
||||
|
|
|
@ -278,7 +278,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