From 1cfd58251c915bebb8262fc94847966e518db79f Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Wed, 22 Jan 2020 18:45:02 +0100 Subject: [PATCH] [ADD] emc : company and contact emails must be different On share subscription for company. --- easy_my_coop/controllers/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/easy_my_coop/controllers/main.py b/easy_my_coop/controllers/main.py index 4bc9b8a..e23ee59 100644 --- a/easy_my_coop/controllers/main.py +++ b/easy_my_coop/controllers/main.py @@ -223,7 +223,12 @@ class WebsiteSubscription(http.Controller): if is_company: is_company = True redirect = "easy_my_coop.becomecompanycooperator" - email = kwargs.get('company_email') + company_email = kwargs.get('company_email') + if email == company_email: + values["error_msg"] = _("Cooperator and company emails" + " should be different.") + return request.website.render(redirect, values) + email = company_email if ('g-recaptcha-response' not in kwargs or not request.website.is_captcha_valid(