|
|
@ -137,7 +137,7 @@ class BetterErrorsMixin:
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if nice:
|
|
|
|
if nice:
|
|
|
|
return {'code': 'field_errors',
|
|
|
|
return {'code': 'field_errors',
|
|
|
|
'message': 'Field validations failed.',
|
|
|
|
'detail': 'Field validations failed.',
|
|
|
|
'errors': nice}
|
|
|
|
'errors': nice}
|
|
|
|
return {}
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
|
@ -158,7 +158,7 @@ class BetterErrorsMixin:
|
|
|
|
ret.append({
|
|
|
|
ret.append({
|
|
|
|
'field': field_name,
|
|
|
|
'field': field_name,
|
|
|
|
'code': error.code,
|
|
|
|
'code': error.code,
|
|
|
|
'message': message,
|
|
|
|
'detail': message,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return ret
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
|
@ -172,7 +172,7 @@ class BetterErrorsMixin:
|
|
|
|
|
|
|
|
|
|
|
|
raise serializers.ValidationError({
|
|
|
|
raise serializers.ValidationError({
|
|
|
|
'code': 'field_errors',
|
|
|
|
'code': 'field_errors',
|
|
|
|
'message': 'Field validations failed.',
|
|
|
|
'detail': 'Field validations failed.',
|
|
|
|
'errors': errors,
|
|
|
|
'errors': errors,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|