mirror of
https://github.com/etesync/server
synced 2024-12-28 18:28:07 +00:00
Serializers: cleanup how we handle validation errors.
This commit is contained in:
parent
3fcea20d68
commit
1cb84cfa6d
@ -149,10 +149,8 @@ class BetterErrorsMixin:
|
||||
ret.extend(self.flatten_errors("{}.{}".format(field_name, error_key), error))
|
||||
else:
|
||||
for error in errors:
|
||||
if hasattr(error, "detail"):
|
||||
message = error.detail[0]
|
||||
elif hasattr(error, "message"):
|
||||
message = error.message
|
||||
if error.messages:
|
||||
message = error.messages[0]
|
||||
else:
|
||||
message = str(error)
|
||||
ret.append(
|
||||
|
Loading…
Reference in New Issue
Block a user