From 9f0a22d3d1d35327e2bf5aee5381a3236d7386df Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO <ynerant@crans.org> Date: Mon, 14 Jun 2021 22:15:35 +0200 Subject: [PATCH] There is not always an error Signed-off-by: Yohann D'ANELLO <ynerant@crans.org> --- apps/member/views.py | 4 ++-- apps/note/models/transactions.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index de44bfe7..1e637f4d 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -671,9 +671,9 @@ class ClubAddMemberView(ProtectQuerysetMixin, ProtectedCreateView): .format(form.instance.club.membership_end)) error = True - if credit_amount: + if credit_amount and not SpecialTransaction.validate_payment_form(form): # Check that special information for payment are filled - error = SpecialTransaction.validate_payment_form(form) or error + error = True return not error diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index 3db82e07..adb20d20 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -348,7 +348,7 @@ class SpecialTransaction(Transaction): first_name = form.cleaned_data["first_name"] bank = form.cleaned_data["bank"] - error = True + error = False if not last_name or not first_name or (not bank and credit_type.special_type == "Chèque"): if not last_name: -- GitLab