From 08e50ffc221a48d5b84af7aed886e71e44ee95ce Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 23 Oct 2020 18:19:21 +0200 Subject: [PATCH] Credit form didn't raise an error when the data didn't validate --- apps/member/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/member/views.py b/apps/member/views.py index 9a585ede..19be50ec 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -677,11 +677,13 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView): if not last_name or not first_name or (not bank and credit_type.special_type == "Chèque"): if not last_name: form.add_error('last_name', _("This field is required.")) + error = True if not first_name: form.add_error('first_name', _("This field is required.")) + error = True if not bank and credit_type.special_type == "Chèque": form.add_error('bank', _("This field is required.")) - return self.form_invalid(form) + error = True return not error