From 30a3f858c5492c5241ee54d99b4f448acb0f848d Mon Sep 17 00:00:00 2001 From: Ferran Quer Guerrero Date: Thu, 13 Feb 2020 19:49:05 +0100 Subject: [PATCH] disable recaptcha. Better spammed than googled --- easy_my_coop_website/__manifest__.py | 1 - easy_my_coop_website/controllers/main.py | 17 ++--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/easy_my_coop_website/__manifest__.py b/easy_my_coop_website/__manifest__.py index 8e62209..73a8396 100644 --- a/easy_my_coop_website/__manifest__.py +++ b/easy_my_coop_website/__manifest__.py @@ -9,7 +9,6 @@ "depends": [ "easy_my_coop", "website", - "website_recaptcha_reloaded", ], "author": "Coop IT Easy SCRLfs", "category": "Cooperative management", diff --git a/easy_my_coop_website/controllers/main.py b/easy_my_coop_website/controllers/main.py index 1a51c46..182aa37 100644 --- a/easy_my_coop_website/controllers/main.py +++ b/easy_my_coop_website/controllers/main.py @@ -207,21 +207,8 @@ class WebsiteSubscription(http.Controller): redirect = "easy_my_coop_website.becomecompanycooperator" email = kwargs.get('company_email') - if 'g-recaptcha-response' not in kwargs or kwargs['g-recaptcha-response'] == '': - values = self.fill_values(values, is_company, logged) - values.update(kwargs) - values["error_msg"] = _("the captcha has not been validated," - " please fill in the captcha") - - return request.render(redirect, values) - elif not request.website.is_captcha_valid( - kwargs['g-recaptcha-response']): - values = self.fill_values(values, is_company, logged) - values.update(kwargs) - values["error_msg"] = _("the captcha has not been validated," - " please fill in the captcha") - - return request.render(redirect, values) + # Original place for Google Captcha. + # Maybe https://github.com/lepture/captcha could help on replacing it # Check that required field from model subscription_request exists required_fields = sub_req_obj.sudo().get_required_field()