From 9452970ec529109fd0b65bb6c62a3061245b4b52 Mon Sep 17 00:00:00 2001 From: houssine Date: Tue, 26 May 2020 18:20:28 +0200 Subject: [PATCH] [FIX] fix swiss localization for iban not required. IBAN number not required so it should not be checked if not provided. --- easy_my_coop_website/controllers/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/easy_my_coop_website/controllers/main.py b/easy_my_coop_website/controllers/main.py index 1fde5bb..ce8ff2e 100644 --- a/easy_my_coop_website/controllers/main.py +++ b/easy_my_coop_website/controllers/main.py @@ -329,12 +329,13 @@ class WebsiteSubscription(http.Controller): return request.render(redirect, values) iban = kwargs.get("iban") - valid = sub_req_obj.check_iban(iban) + if iban.strip(): + valid = sub_req_obj.check_iban(iban) - if not valid: - values = self.fill_values(values, is_company, logged) - values["error_msg"] = _("You iban account number is not valid") - return request.render(redirect, values) + if not valid: + values = self.fill_values(values, is_company, logged) + values["error_msg"] = _("You iban account number is not valid") + return request.render(redirect, values) # check the subscription's amount max_amount = company.subscription_maximum_amount