Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] cooperator_website_recaptcha #110

Open
wants to merge 16 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions cooperator_website_recaptcha/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
=============================
Cooperators Website reCAPTCHA
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d7052e563ba6aefe735d7262009fd4f72301aa99b96f9e8945cf9960505c5b12
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcooperative-lightgray.png?logo=github
:target: https://github.com/OCA/cooperative/tree/16.0/cooperator_website_recaptcha
:alt: OCA/cooperative
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/cooperative-16-0/cooperative-16-0-cooperator_website_recaptcha
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/cooperative&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Add Google Recaptcha to Subscription Request Form

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/cooperative/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/cooperative/issues/new?body=module:%20cooperator_website_recaptcha%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Coop IT Easy SC

Contributors
~~~~~~~~~~~~

* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Carmen Bianca Bakker
* hugues de keyzer

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/cooperative <https://github.com/OCA/cooperative/tree/16.0/cooperator_website_recaptcha>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions cooperator_website_recaptcha/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import controllers
19 changes: 19 additions & 0 deletions cooperator_website_recaptcha/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 Coop IT Easy SC
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Cooperators Website reCAPTCHA",
"summary": "Add reCAPTCHA to Subscription Request Form",
"version": "16.0.1.0.0",
"category": "Cooperative management",
"website": "https://github.com/OCA/cooperative",
"author": "Coop IT Easy SC, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"cooperator_website",
"website_recaptcha_v2",
],
"data": [
"views/subscription_template.xml",
],
}
1 change: 1 addition & 0 deletions cooperator_website_recaptcha/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
17 changes: 17 additions & 0 deletions cooperator_website_recaptcha/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from odoo.http import request
from odoo.tools.translate import _

from odoo.addons.cooperator_website.controllers.main import WebsiteSubscription


class RecaptchaWebsiteSubscription(WebsiteSubscription):
def _additional_validate(self, kwargs, logged, values, post_file):
result = super()._additional_validate(kwargs, logged, values, post_file)
if result is not True:
return result
result, error_msg = request.website.is_recaptcha_v2_valid(kwargs)
if not result:
values["error_msg"] = _("Error validating the CAPTCHA: {0}").format(
error_msg
)
return result
56 changes: 56 additions & 0 deletions cooperator_website_recaptcha/i18n/cooperator_website_recaptcha.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * cooperator_website_recaptcha
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: cooperator_website_recaptcha
#: model:ir.model.fields,field_description:cooperator_website_recaptcha.field_res_company__captcha_type
msgid "Captcha type or disabled"
msgstr ""

#. module: cooperator_website_recaptcha
#: model:ir.model,name:cooperator_website_recaptcha.model_res_company
msgid "Companies"
msgstr ""

#. module: cooperator_website_recaptcha
#: model:ir.model.fields.selection,name:cooperator_website_recaptcha.selection__res_company__captcha_type__none
msgid "Disabled"
msgstr ""

#. module: cooperator_website_recaptcha
#: model:ir.model.fields,field_description:cooperator_website_recaptcha.field_res_company__display_name
msgid "Display Name"
msgstr ""

#. module: cooperator_website_recaptcha
#: model:ir.model.fields.selection,name:cooperator_website_recaptcha.selection__res_company__captcha_type__google
msgid "Google Recaptcha"
msgstr ""

#. module: cooperator_website_recaptcha
#: model:ir.model.fields,field_description:cooperator_website_recaptcha.field_res_company__id
msgid "ID"
msgstr ""

#. module: cooperator_website_recaptcha
#: model:ir.model.fields,field_description:cooperator_website_recaptcha.field_res_company____last_update
msgid "Last Modified on"
msgstr ""

#. module: cooperator_website_recaptcha
#: code:addons/cooperator_website_recaptcha/controllers/main.py:0
#: code:addons/cooperator_website_recaptcha/controllers/main.py:0
#, python-format
msgid "the captcha has not been validated, please fill in the captcha"
msgstr ""
4 changes: 4 additions & 0 deletions cooperator_website_recaptcha/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Coop IT Easy SC <https://coopiteasy.be>`_:

* Carmen Bianca Bakker
* hugues de keyzer
1 change: 1 addition & 0 deletions cooperator_website_recaptcha/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add Google Recaptcha to Subscription Request Form
Loading
Loading