From 2de51b978abfac206f05624faacbbfa414cef32c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 24 Dec 2020 16:14:52 +0200 Subject: [PATCH] Serializers: fix an issue with handling validation errors. --- django_etebase/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_etebase/serializers.py b/django_etebase/serializers.py index 1e5c78e..32a2757 100644 --- a/django_etebase/serializers.py +++ b/django_etebase/serializers.py @@ -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)