Serializers: fix an issue with handling validation errors.
This commit is contained in:
parent
7eb08d2946
commit
2de51b978a
@ -149,7 +149,7 @@ class BetterErrorsMixin:
|
||||
ret.extend(self.flatten_errors("{}.{}".format(field_name, error_key), error))
|
||||
else:
|
||||
for error in errors:
|
||||
if error.messages:
|
||||
if getattr(error, "messages", None):
|
||||
message = error.messages[0]
|
||||
else:
|
||||
message = str(error)
|
||||
|
Loading…
Reference in New Issue
Block a user