Serializers: rename message to detail to conform with the rest of the API.
This was a mistake in the previous commit.
This commit is contained in:
parent
bf22b1676f
commit
7ab9513e05
@ -137,7 +137,7 @@ class BetterErrorsMixin:
|
||||
)
|
||||
if nice:
|
||||
return {'code': 'field_errors',
|
||||
'message': 'Field validations failed.',
|
||||
'detail': 'Field validations failed.',
|
||||
'errors': nice}
|
||||
return {}
|
||||
|
||||
@ -158,7 +158,7 @@ class BetterErrorsMixin:
|
||||
ret.append({
|
||||
'field': field_name,
|
||||
'code': error.code,
|
||||
'message': message,
|
||||
'detail': message,
|
||||
})
|
||||
return ret
|
||||
|
||||
@ -172,7 +172,7 @@ class BetterErrorsMixin:
|
||||
|
||||
raise serializers.ValidationError({
|
||||
'code': 'field_errors',
|
||||
'message': 'Field validations failed.',
|
||||
'detail': 'Field validations failed.',
|
||||
'errors': errors,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user