From e0080c5db0d2343f6fb2f717cebf3c5a697820ff Mon Sep 17 00:00:00 2001 From: Yajo Date: Tue, 31 May 2016 16:41:28 +0200 Subject: [PATCH 01/31] [9.0][MIG][auth_signup_verify_email] Migration. (#436) * Add module auth_signup_verify_email. * Import module following guidelines. * README typos. * OCA Transbot updated translations from Transifex * Credit creator. * author name correction * [9.0][MIG][auth_signup_verify_email] Migration. Migrate to v9. * [FIX] auth_signup_verify_email: Python library requirement * Add tests, fix xml tags, fix credits. * Fix test. --- auth_signup_verify_email/README.rst | 87 +++++++++ auth_signup_verify_email/__init__.py | 5 + auth_signup_verify_email/__openerp__.py | 28 +++ .../controllers/__init__.py | 5 + auth_signup_verify_email/controllers/main.py | 55 ++++++ auth_signup_verify_email/i18n/de.po | 47 +++++ auth_signup_verify_email/i18n/es.po | 48 +++++ auth_signup_verify_email/i18n/it.po | 47 +++++ auth_signup_verify_email/i18n/pt_BR.po | 46 +++++ auth_signup_verify_email/i18n/sl.po | 47 +++++ auth_signup_verify_email/i18n/tr.po | 47 +++++ .../static/description/icon.png | Bin 0 -> 10549 bytes .../static/description/icon.svg | 172 ++++++++++++++++++ auth_signup_verify_email/tests/__init__.py | 5 + .../tests/test_verify_email.py | 72 ++++++++ auth_signup_verify_email/views/signup.xml | 20 ++ 16 files changed, 731 insertions(+) create mode 100644 auth_signup_verify_email/README.rst create mode 100644 auth_signup_verify_email/__init__.py create mode 100644 auth_signup_verify_email/__openerp__.py create mode 100644 auth_signup_verify_email/controllers/__init__.py create mode 100644 auth_signup_verify_email/controllers/main.py create mode 100644 auth_signup_verify_email/i18n/de.po create mode 100644 auth_signup_verify_email/i18n/es.po create mode 100644 auth_signup_verify_email/i18n/it.po create mode 100644 auth_signup_verify_email/i18n/pt_BR.po create mode 100644 auth_signup_verify_email/i18n/sl.po create mode 100644 auth_signup_verify_email/i18n/tr.po create mode 100644 auth_signup_verify_email/static/description/icon.png create mode 100644 auth_signup_verify_email/static/description/icon.svg create mode 100644 auth_signup_verify_email/tests/__init__.py create mode 100644 auth_signup_verify_email/tests/test_verify_email.py create mode 100644 auth_signup_verify_email/views/signup.xml diff --git a/auth_signup_verify_email/README.rst b/auth_signup_verify_email/README.rst new file mode 100644 index 0000000000..041de578ee --- /dev/null +++ b/auth_signup_verify_email/README.rst @@ -0,0 +1,87 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +====================== +Verify email at signup +====================== + +This module extends the functionality of public sign up, and forces users to +provide a valid email address. + +To achieve this requirement, the user does not need to provide a password at +sign up, but when logging in later for the first time. + +Installation +============ + +* Install validate_email_ with ``pip install validate_email`` or equivalent. + +Configuration +============= + +To configure this module, you need to: + +* `Properly configure your outgoing email server(s) + `_. +* Go to *Settings > General Settings* and enable *Allow + external users to sign up*. + +Usage +===== + +To use this module, you need to: + +* Log out. +* `Sign up `_ with a valid email. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/149/9.0 + +Known issues / Roadmap +====================== + +* Remove calls to ``cr.commit()`` in tests when + https://github.com/odoo/odoo/issues/12237 gets fixed. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + + +Credits +======= + +Icon +---- + +* https://openclipart.org/detail/3040/thumbtack-note-email +* https://openclipart.org/detail/202732/check-mark + +Contributors +------------ + +* Rafael Blasco +* Jairo Llopis + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. + +.. _validate_email: https://pypi.python.org/pypi/validate_email diff --git a/auth_signup_verify_email/__init__.py b/auth_signup_verify_email/__init__.py new file mode 100644 index 0000000000..35233d377a --- /dev/null +++ b/auth_signup_verify_email/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería, S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import controllers diff --git a/auth_signup_verify_email/__openerp__.py b/auth_signup_verify_email/__openerp__.py new file mode 100644 index 0000000000..6ac75954b6 --- /dev/null +++ b/auth_signup_verify_email/__openerp__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería, S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Verify email at signup", + "summary": "Force uninvited users to use a good email for signup", + "version": "9.0.1.0.0", + "category": "Authentication", + "website": "http://www.tecnativa.com", + "author": "Antiun Ingeniería S.L., " + "Tecnativa, " + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "external_dependencies": { + "python": [ + "lxml", + "validate_email", + ], + }, + "depends": [ + "auth_signup", + ], + "data": [ + "views/signup.xml", + ], +} diff --git a/auth_signup_verify_email/controllers/__init__.py b/auth_signup_verify_email/controllers/__init__.py new file mode 100644 index 0000000000..d10129bede --- /dev/null +++ b/auth_signup_verify_email/controllers/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería, S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import main diff --git a/auth_signup_verify_email/controllers/main.py b/auth_signup_verify_email/controllers/main.py new file mode 100644 index 0000000000..506e937444 --- /dev/null +++ b/auth_signup_verify_email/controllers/main.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería, S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import logging +from openerp import _, http +from openerp.addons.auth_signup.controllers.main import AuthSignupHome + +_logger = logging.getLogger(__name__) + +try: + from validate_email import validate_email +except ImportError: + _logger.debug("Cannot import `validate_email`.") + + +class SignupVerifyEmail(AuthSignupHome): + @http.route() + def web_auth_signup(self, *args, **kw): + if (http.request.params.get("login") and + not http.request.params.get("password")): + return self.passwordless_signup(http.request.params) + else: + return super(SignupVerifyEmail, self).web_auth_signup(*args, **kw) + + def passwordless_signup(self, values): + qcontext = self.get_auth_signup_qcontext() + + # Check good format of e-mail + if not validate_email(values.get("login", "")): + qcontext["error"] = _("That does not seem to be an email address.") + return http.request.render("auth_signup.signup", qcontext) + elif not values.get("email"): + values["email"] = values.get("login") + + # Remove password + values["password"] = False + sudo_users = (http.request.env["res.users"] + .with_context(create_user=True).sudo()) + + try: + with http.request.cr.savepoint(): + sudo_users.signup(values, qcontext.get("token")) + sudo_users.reset_password(values.get("login")) + except Exception as error: + # Duplicate key or wrong SMTP settings, probably + _logger.exception(error) + + # Agnostic message for security + qcontext["error"] = _( + "Something went wrong, please try again later or contact us.") + return http.request.render("auth_signup.signup", qcontext) + + qcontext["message"] = _("Check your email to activate your account!") + return http.request.render("auth_signup.reset_password", qcontext) diff --git a/auth_signup_verify_email/i18n/de.po b/auth_signup_verify_email/i18n/de.po new file mode 100644 index 0000000000..367716b401 --- /dev/null +++ b/auth_signup_verify_email/i18n/de.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-18 13:24+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Prüfen Sie Ihre Email, um Ihr Konto zu aktivieren." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Etwas ist schief gelaufen, bitte später nochmal versuchen oden an uns wenden." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Das schein keine Email-Adresse zu sein." + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "email" +msgstr "EMail" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "only_passwords" +msgstr "" diff --git a/auth_signup_verify_email/i18n/es.po b/auth_signup_verify_email/i18n/es.po new file mode 100644 index 0000000000..c170d4fc5c --- /dev/null +++ b/auth_signup_verify_email/i18n/es.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Antonio Trueba, 2016 +# Antonio Trueba, 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-02-16 15:15+0000\n" +"Last-Translator: Antonio Trueba\n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Revise su correo para activar su cuenta." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Algo ha ido mal, por favor inténtelo de nuevo más tarde o contáctenos." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Eso no parece una dirección de email válida." + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "email" +msgstr "email" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "only_passwords" +msgstr "" diff --git a/auth_signup_verify_email/i18n/it.po b/auth_signup_verify_email/i18n/it.po new file mode 100644 index 0000000000..75bd3e908e --- /dev/null +++ b/auth_signup_verify_email/i18n/it.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Paolo Valier, 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-17 15:36+0000\n" +"PO-Revision-Date: 2016-03-13 08:59+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Controlla la tua email per attivare il tuo account!" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Qualcosa non è funzionato, prego provare più tardi altrimenti mettiti in contatto con noi." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Questo non sembra essere un indirizzo email valido." + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "email" +msgstr "email" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "only_passwords" +msgstr "" diff --git a/auth_signup_verify_email/i18n/pt_BR.po b/auth_signup_verify_email/i18n/pt_BR.po new file mode 100644 index 0000000000..1a9ead1bb1 --- /dev/null +++ b/auth_signup_verify_email/i18n/pt_BR.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-27 14:01+0000\n" +"PO-Revision-Date: 2015-11-12 20:16+0000\n" +"Last-Translator: <>\n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#, python-format +msgid "Check your email to activate your account!" +msgstr "" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#, python-format +msgid "That does not seem to be an email address." +msgstr "" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "email" +msgstr "email" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "only_passwords" +msgstr "" diff --git a/auth_signup_verify_email/i18n/sl.po b/auth_signup_verify_email/i18n/sl.po new file mode 100644 index 0000000000..612e35cc63 --- /dev/null +++ b/auth_signup_verify_email/i18n/sl.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-27 14:01+0000\n" +"PO-Revision-Date: 2015-11-13 11:44+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Preverite svojo e-pošto za aktiviranje računa!" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Nekaj je narobe. Ponovno poskusite kasneje ali pa stopite v stik z nami." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Kaže, da to ni e-poštni naslov." + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "email" +msgstr "e-pošta" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "only_passwords" +msgstr "only_passwords" diff --git a/auth_signup_verify_email/i18n/tr.po b/auth_signup_verify_email/i18n/tr.po new file mode 100644 index 0000000000..a41abef839 --- /dev/null +++ b/auth_signup_verify_email/i18n/tr.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Ahmet Altınışık , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-19 14:44+0000\n" +"PO-Revision-Date: 2016-01-31 14:58+0000\n" +"Last-Translator: Ahmet Altınışık \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Hesabınızı aktive etmek için e-postanızı kontrol edin!" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Bişeyler ters gitti. Lütfen sonra tekrar deneyin ya da bize ulaşın." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Bu bir e-posta adresi gözükmüyor." + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "email" +msgstr "eposta" + +#. module: auth_signup_verify_email +#: view:website:auth_signup.fields +msgid "only_passwords" +msgstr "sadece_parolalar" diff --git a/auth_signup_verify_email/static/description/icon.png b/auth_signup_verify_email/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..52e1b17dcb661d98f613efecf525de26b26fe8c6 GIT binary patch literal 10549 zcmV-5DazJ~P)`h+6;vAOJ~3 zK~#9!?VWjimDhRazvo@l7AX7dIZ3&vV`*xM?@-rrorg_I|aMD_6edYf=}#J?PIDH>dc`ZP$iJsapDp z0e|0l?gxghyI~*-B!y7%(D3i6t(%|c)`hp<1mt?{h4qhe+p>WHNL=_%1jqz3gb+C> zHBJaM4Ojp?u9SEnQt+MlV87q^W1jpqYk$TESKQa8jwG#6|!y9lgwT8kpX`nKmYwqUGwu$&RvvOSH1rMS=3U*rrf%If48uuh|Rfm9NoK>@l$U_DG>dP zvgyn}8R0-GUnn_D2r*PCMk2Tcm?%&afU?0{o8txU%qsfkvwt)zWMOj=oAc_rCw~Y~ z2$(?ga22b4H1AO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XHuvxp0ID|5{MxitbMMZc^hF(@{AWvVPR_d$ zPky?DncHUc$wn%EvH0f1+_al^({9>LyJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + + 2007-02-06T06:13:53 + Thumbtack note with message "E-mail!" + https://openclipart.org/detail/3040/thumbtack-note-email-by-zeimusu + + + zeimusu + + + + + bulletin + email + memo + note + thumbtack + thumbtack note + + + + + + + + + + + diff --git a/auth_signup_verify_email/tests/__init__.py b/auth_signup_verify_email/tests/__init__.py new file mode 100644 index 0000000000..8858be4966 --- /dev/null +++ b/auth_signup_verify_email/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_verify_email diff --git a/auth_signup_verify_email/tests/test_verify_email.py b/auth_signup_verify_email/tests/test_verify_email.py new file mode 100644 index 0000000000..a3649cd7de --- /dev/null +++ b/auth_signup_verify_email/tests/test_verify_email.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# © 2016 Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from urllib import urlencode +from lxml.html import document_fromstring +from openerp import _ +from openerp.tests.common import HttpCase + + +class UICase(HttpCase): + def setUp(self): + super(UICase, self).setUp() + self.icp = self.env["ir.config_parameter"] + self.old_allow_uninvited = self.icp.get_param( + "auth_signup.allow_uninvited") + self.icp.set_param("auth_signup.allow_uninvited", "True") + + # Workaround https://github.com/odoo/odoo/issues/12237 + self.cr.commit() + + self.data = { + "csrf_token": self.csrf_token(), + "name": "Somebody", + } + self.msg = { + "badmail": _("That does not seem to be an email address."), + "failure": _( + "Something went wrong, please try again later or contact us."), + "success": _("Check your email to activate your account!"), + } + + def tearDown(self): + """Workaround https://github.com/odoo/odoo/issues/12237.""" + super(UICase, self).tearDown() + self.icp.set_param( + "auth_signup.allow_uninvited", self.old_allow_uninvited) + self.cr.commit() + + def html_doc(self, url="/web/signup", data=None, timeout=10): + """Get an HTML LXML document.""" + if data: + data = bytes(urlencode(data)) + return document_fromstring(self.url_open(url, data, timeout).read()) + + def csrf_token(self): + """Get a valid CSRF token.""" + doc = self.html_doc() + return doc.xpath("//input[@name='csrf_token']")[0].get("value") + + def search_text(self, doc, text): + """Search for any element containing the text.""" + return doc.xpath("//*[contains(text(), '%s')]" % text) + + def test_bad_email(self): + """Test rejection of bad emails.""" + self.data["login"] = "bad email" + doc = self.html_doc(data=self.data) + self.assertTrue(self.search_text(doc, self.msg["badmail"])) + + def test_good_email(self): + """Test acceptance of good emails. + + This test could lead to success if your SMTP settings are correct, or + to failure otherwise. Any case is expected, since tests usually run + under unconfigured demo instances. + """ + self.data["login"] = "good@example.com" + doc = self.html_doc(data=self.data) + self.assertTrue( + self.search_text(doc, self.msg["failure"]) or + self.search_text(doc, self.msg["success"])) diff --git a/auth_signup_verify_email/views/signup.xml b/auth_signup_verify_email/views/signup.xml new file mode 100644 index 0000000000..cc81fcccf2 --- /dev/null +++ b/auth_signup_verify_email/views/signup.xml @@ -0,0 +1,20 @@ + + + + + + + From 201d940b792ea08c9a160ea122a2fe6b1810687e Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 27 Jan 2017 16:35:47 +0100 Subject: [PATCH 02/31] [MIG][10] auth_signup_verify_email * Module set to installable * Odoo don't let signup without password --- .../{__openerp__.py => __manifest__.py} | 4 ++-- auth_signup_verify_email/controllers/main.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename auth_signup_verify_email/{__openerp__.py => __manifest__.py} (92%) diff --git a/auth_signup_verify_email/__openerp__.py b/auth_signup_verify_email/__manifest__.py similarity index 92% rename from auth_signup_verify_email/__openerp__.py rename to auth_signup_verify_email/__manifest__.py index 6ac75954b6..3908671e10 100644 --- a/auth_signup_verify_email/__openerp__.py +++ b/auth_signup_verify_email/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Verify email at signup", "summary": "Force uninvited users to use a good email for signup", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "category": "Authentication", "website": "http://www.tecnativa.com", "author": "Antiun Ingeniería S.L., " @@ -12,7 +12,7 @@ "Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, - "installable": True, + 'installable': True, "external_dependencies": { "python": [ "lxml", diff --git a/auth_signup_verify_email/controllers/main.py b/auth_signup_verify_email/controllers/main.py index 506e937444..0fb5e06638 100644 --- a/auth_signup_verify_email/controllers/main.py +++ b/auth_signup_verify_email/controllers/main.py @@ -3,8 +3,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import logging -from openerp import _, http -from openerp.addons.auth_signup.controllers.main import AuthSignupHome +from odoo import _, http +from odoo.addons.auth_signup.controllers.main import AuthSignupHome _logger = logging.getLogger(__name__) @@ -34,7 +34,7 @@ def passwordless_signup(self, values): values["email"] = values.get("login") # Remove password - values["password"] = False + values["password"] = "" sudo_users = (http.request.env["res.users"] .with_context(create_user=True).sudo()) From 8ec7fe99437ad0af160835a9e0b78c7947b5c978 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 12 Jun 2016 12:55:45 -0400 Subject: [PATCH 03/31] OCA Transbot updated translations from Transifex --- auth_signup_verify_email/i18n/de.po | 23 +++++---------- auth_signup_verify_email/i18n/es.po | 24 +++++---------- auth_signup_verify_email/i18n/fr.po | 41 ++++++++++++++++++++++++++ auth_signup_verify_email/i18n/hr.po | 40 +++++++++++++++++++++++++ auth_signup_verify_email/i18n/hr_HR.po | 40 +++++++++++++++++++++++++ auth_signup_verify_email/i18n/it.po | 23 +++++---------- auth_signup_verify_email/i18n/ro.po | 41 ++++++++++++++++++++++++++ auth_signup_verify_email/i18n/sl.po | 23 +++++---------- auth_signup_verify_email/i18n/tr.po | 23 +++++---------- 9 files changed, 202 insertions(+), 76 deletions(-) create mode 100644 auth_signup_verify_email/i18n/fr.po create mode 100644 auth_signup_verify_email/i18n/hr.po create mode 100644 auth_signup_verify_email/i18n/hr_HR.po create mode 100644 auth_signup_verify_email/i18n/ro.po diff --git a/auth_signup_verify_email/i18n/de.po b/auth_signup_verify_email/i18n/de.po index 367716b401..d378fe7e65 100644 --- a/auth_signup_verify_email/i18n/de.po +++ b/auth_signup_verify_email/i18n/de.po @@ -6,12 +6,12 @@ # Rudolf Schnapka , 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: server-tools (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-01-18 13:24+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-8-0/language/de/)\n" +"POT-Creation-Date: 2016-06-09 12:31+0000\n" +"PO-Revision-Date: 2016-05-31 14:47+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-9-0/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,28 +20,21 @@ msgstr "" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 #, python-format msgid "Check your email to activate your account!" msgstr "Prüfen Sie Ihre Email, um Ihr Konto zu aktivieren." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 #, python-format msgid "Something went wrong, please try again later or contact us." msgstr "Etwas ist schief gelaufen, bitte später nochmal versuchen oden an uns wenden." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 #, python-format msgid "That does not seem to be an email address." msgstr "Das schein keine Email-Adresse zu sein." - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "email" -msgstr "EMail" - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "only_passwords" -msgstr "" diff --git a/auth_signup_verify_email/i18n/es.po b/auth_signup_verify_email/i18n/es.po index c170d4fc5c..08ca0a8704 100644 --- a/auth_signup_verify_email/i18n/es.po +++ b/auth_signup_verify_email/i18n/es.po @@ -4,15 +4,14 @@ # # Translators: # Antonio Trueba, 2016 -# Antonio Trueba, 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: server-tools (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-02-16 15:15+0000\n" -"Last-Translator: Antonio Trueba\n" -"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/es/)\n" +"POT-Creation-Date: 2016-06-09 12:31+0000\n" +"PO-Revision-Date: 2016-05-31 14:47+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-server-tools-9-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -21,28 +20,21 @@ msgstr "" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 #, python-format msgid "Check your email to activate your account!" msgstr "Revise su correo para activar su cuenta." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 #, python-format msgid "Something went wrong, please try again later or contact us." msgstr "Algo ha ido mal, por favor inténtelo de nuevo más tarde o contáctenos." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 #, python-format msgid "That does not seem to be an email address." msgstr "Eso no parece una dirección de email válida." - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "email" -msgstr "email" - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "only_passwords" -msgstr "" diff --git a/auth_signup_verify_email/i18n/fr.po b/auth_signup_verify_email/i18n/fr.po new file mode 100644 index 0000000000..1798756c61 --- /dev/null +++ b/auth_signup_verify_email/i18n/fr.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Alexandre Papin , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-18 02:19+0000\n" +"PO-Revision-Date: 2017-03-18 02:19+0000\n" +"Last-Translator: Alexandre Papin , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Un email vous à été envoyé pour activer votre compte." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "" +"Une erreur est survenue, veuillez réessayer plus tard ou contactez nous." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Veuillez fournir une adresse email valide." diff --git a/auth_signup_verify_email/i18n/hr.po b/auth_signup_verify_email/i18n/hr.po new file mode 100644 index 0000000000..1b97b61ec3 --- /dev/null +++ b/auth_signup_verify_email/i18n/hr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-10 00:47+0000\n" +"PO-Revision-Date: 2017-05-10 00:47+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Provjerite svoj e-mail za aktivaciu računa!" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Nešto nije u redu, molimo pokušajte ponovo ili nas kontaktirajte." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Ovo ne izgleda kao e-mail adresa." diff --git a/auth_signup_verify_email/i18n/hr_HR.po b/auth_signup_verify_email/i18n/hr_HR.po new file mode 100644 index 0000000000..cb4d2e312d --- /dev/null +++ b/auth_signup_verify_email/i18n/hr_HR.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: server-tools (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-29 00:48+0000\n" +"PO-Revision-Date: 2016-06-13 08:38+0000\n" +"Last-Translator: Bole \n" +"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-server-tools-9-0/language/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Provjerite svoj mail za aktiviranje računa" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "Nešto nije u redu, molimo pokušajte se prijaviti kasnije ili nas kontaktirajte." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Ovo ne izgleda kao valjana mail adresa." diff --git a/auth_signup_verify_email/i18n/it.po b/auth_signup_verify_email/i18n/it.po index 75bd3e908e..e3198c1d31 100644 --- a/auth_signup_verify_email/i18n/it.po +++ b/auth_signup_verify_email/i18n/it.po @@ -6,12 +6,12 @@ # Paolo Valier, 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: server-tools (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-17 15:36+0000\n" -"PO-Revision-Date: 2016-03-13 08:59+0000\n" -"Last-Translator: Paolo Valier\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/it/)\n" +"POT-Creation-Date: 2016-06-09 12:31+0000\n" +"PO-Revision-Date: 2016-05-31 14:47+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-9-0/language/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,28 +20,21 @@ msgstr "" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 #, python-format msgid "Check your email to activate your account!" msgstr "Controlla la tua email per attivare il tuo account!" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 #, python-format msgid "Something went wrong, please try again later or contact us." msgstr "Qualcosa non è funzionato, prego provare più tardi altrimenti mettiti in contatto con noi." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 #, python-format msgid "That does not seem to be an email address." msgstr "Questo non sembra essere un indirizzo email valido." - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "email" -msgstr "email" - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "only_passwords" -msgstr "" diff --git a/auth_signup_verify_email/i18n/ro.po b/auth_signup_verify_email/i18n/ro.po new file mode 100644 index 0000000000..561d092360 --- /dev/null +++ b/auth_signup_verify_email/i18n/ro.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * auth_signup_verify_email +# +# Translators: +# Daniel Schweiger , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-22 01:11+0000\n" +"PO-Revision-Date: 2017-06-22 01:11+0000\n" +"Last-Translator: Daniel Schweiger , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ro\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 +#, python-format +msgid "Check your email to activate your account!" +msgstr "Ati primit un email pentru activarea acestui cont!" + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 +#, python-format +msgid "Something went wrong, please try again later or contact us." +msgstr "" +"Sa produs o eroare, va rugam sa incercati mai tarziu sau contacteaza-ne." + +#. module: auth_signup_verify_email +#: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 +#, python-format +msgid "That does not seem to be an email address." +msgstr "Nu ati introdus o directie email corespunzatoare." diff --git a/auth_signup_verify_email/i18n/sl.po b/auth_signup_verify_email/i18n/sl.po index 612e35cc63..bdfb829c5e 100644 --- a/auth_signup_verify_email/i18n/sl.po +++ b/auth_signup_verify_email/i18n/sl.po @@ -6,12 +6,12 @@ # Matjaž Mozetič , 2015 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: server-tools (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-27 14:01+0000\n" -"PO-Revision-Date: 2015-11-13 11:44+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" +"POT-Creation-Date: 2016-06-09 12:31+0000\n" +"PO-Revision-Date: 2016-05-31 14:47+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-9-0/language/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,28 +20,21 @@ msgstr "" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 #, python-format msgid "Check your email to activate your account!" msgstr "Preverite svojo e-pošto za aktiviranje računa!" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 #, python-format msgid "Something went wrong, please try again later or contact us." msgstr "Nekaj je narobe. Ponovno poskusite kasneje ali pa stopite v stik z nami." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 #, python-format msgid "That does not seem to be an email address." msgstr "Kaže, da to ni e-poštni naslov." - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "email" -msgstr "e-pošta" - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "only_passwords" -msgstr "only_passwords" diff --git a/auth_signup_verify_email/i18n/tr.po b/auth_signup_verify_email/i18n/tr.po index a41abef839..b6fbbab043 100644 --- a/auth_signup_verify_email/i18n/tr.po +++ b/auth_signup_verify_email/i18n/tr.po @@ -6,12 +6,12 @@ # Ahmet Altınışık , 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: server-tools (9.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-01-19 14:44+0000\n" -"PO-Revision-Date: 2016-01-31 14:58+0000\n" -"Last-Translator: Ahmet Altınışık \n" -"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-8-0/language/tr/)\n" +"POT-Creation-Date: 2016-06-09 12:31+0000\n" +"PO-Revision-Date: 2016-05-31 14:47+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Turkish (http://www.transifex.com/oca/OCA-server-tools-9-0/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -20,28 +20,21 @@ msgstr "" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:54 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:30 #, python-format msgid "Check your email to activate your account!" msgstr "Hesabınızı aktive etmek için e-postanızı kontrol edin!" #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:50 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:28 #, python-format msgid "Something went wrong, please try again later or contact us." msgstr "Bişeyler ters gitti. Lütfen sonra tekrar deneyin ya da bize ulaşın." #. module: auth_signup_verify_email #: code:addons/auth_signup_verify_email/controllers/main.py:31 +#: code:addons/auth_signup_verify_email/tests/test_verify_email.py:27 #, python-format msgid "That does not seem to be an email address." msgstr "Bu bir e-posta adresi gözükmüyor." - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "email" -msgstr "eposta" - -#. module: auth_signup_verify_email -#: view:website:auth_signup.fields -msgid "only_passwords" -msgstr "sadece_parolalar" From a6cfd3b658a79ae9a65ac48a79a3d53bd6439b4e Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Mon, 22 Jan 2018 18:30:09 +0100 Subject: [PATCH 04/31] [MIG][11] auth_signup_verify_email --- auth_signup_verify_email/README.rst | 18 +++++++------- auth_signup_verify_email/__init__.py | 3 +-- auth_signup_verify_email/__manifest__.py | 16 ++++++------- .../controllers/__init__.py | 3 +-- auth_signup_verify_email/controllers/main.py | 24 +++++++++++-------- auth_signup_verify_email/tests/__init__.py | 2 +- .../tests/test_verify_email.py | 15 ++++++------ auth_signup_verify_email/views/signup.xml | 6 ++--- 8 files changed, 42 insertions(+), 45 deletions(-) diff --git a/auth_signup_verify_email/README.rst b/auth_signup_verify_email/README.rst index 041de578ee..e7ebc18d56 100644 --- a/auth_signup_verify_email/README.rst +++ b/auth_signup_verify_email/README.rst @@ -6,16 +6,16 @@ Verify email at signup ====================== -This module extends the functionality of public sign up, and forces users to +This module extends the functionality of public sign up to force users to provide a valid email address. -To achieve this requirement, the user does not need to provide a password at -sign up, but when logging in later for the first time. +To achieve this, users are not required to provide a password at +sign up: they are asked for only at first login attempt. Installation ============ -* Install validate_email_ with ``pip install validate_email`` or equivalent. +* Install `validate_email `_ with ``pip install validate_email`` or equivalent. Configuration ============= @@ -24,8 +24,7 @@ To configure this module, you need to: * `Properly configure your outgoing email server(s) `_. -* Go to *Settings > General Settings* and enable *Allow - external users to sign up*. +* Go to *Settings > General Settings -> General settings*, search for the *Users* section and enable *Free sign up* in *Customer account*. Usage ===== @@ -37,7 +36,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/149/9.0 + :target: https://runbot.odoo-community.org/runbot/149/11.0 Known issues / Roadmap ====================== @@ -51,7 +50,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +help us smash it by providing detailed and welcomed feedback. Credits @@ -68,6 +67,7 @@ Contributors * Rafael Blasco * Jairo Llopis +* Simone Orsi Maintainer ---------- @@ -83,5 +83,3 @@ mission is to support the collaborative development of Odoo features and promote its widespread use. To contribute to this module, please visit https://odoo-community.org. - -.. _validate_email: https://pypi.python.org/pypi/validate_email diff --git a/auth_signup_verify_email/__init__.py b/auth_signup_verify_email/__init__.py index 35233d377a..54d1454ece 100644 --- a/auth_signup_verify_email/__init__.py +++ b/auth_signup_verify_email/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2015 Antiun Ingeniería, S.L. +# Copyright 2015 Antiun Ingeniería, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import controllers diff --git a/auth_signup_verify_email/__manifest__.py b/auth_signup_verify_email/__manifest__.py index 3908671e10..a965fefa4d 100644 --- a/auth_signup_verify_email/__manifest__.py +++ b/auth_signup_verify_email/__manifest__.py @@ -1,28 +1,26 @@ -# -*- coding: utf-8 -*- -# © 2015 Antiun Ingeniería, S.L. +# Copyright 2015 Antiun Ingeniería, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Verify email at signup", "summary": "Force uninvited users to use a good email for signup", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "category": "Authentication", - "website": "http://www.tecnativa.com", + "website": "https://github.com/OCA/server-auth", "author": "Antiun Ingeniería S.L., " "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", - "application": False, - 'installable': True, + "depends": [ + "auth_signup", + ], "external_dependencies": { "python": [ "lxml", "validate_email", ], }, - "depends": [ - "auth_signup", - ], "data": [ "views/signup.xml", ], + 'installable': True, } diff --git a/auth_signup_verify_email/controllers/__init__.py b/auth_signup_verify_email/controllers/__init__.py index d10129bede..437ebe48e0 100644 --- a/auth_signup_verify_email/controllers/__init__.py +++ b/auth_signup_verify_email/controllers/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2015 Antiun Ingeniería, S.L. +# Copyright 2015 Antiun Ingeniería, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import main diff --git a/auth_signup_verify_email/controllers/main.py b/auth_signup_verify_email/controllers/main.py index 0fb5e06638..38ad7e4742 100644 --- a/auth_signup_verify_email/controllers/main.py +++ b/auth_signup_verify_email/controllers/main.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- -# © 2015 Antiun Ingeniería, S.L. +# Copyright 2015 Antiun Ingeniería, S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import logging from odoo import _, http +from odoo.http import request from odoo.addons.auth_signup.controllers.main import AuthSignupHome _logger = logging.getLogger(__name__) @@ -15,11 +15,12 @@ class SignupVerifyEmail(AuthSignupHome): + @http.route() def web_auth_signup(self, *args, **kw): - if (http.request.params.get("login") and - not http.request.params.get("password")): - return self.passwordless_signup(http.request.params) + if (request.params.get("login") and + not request.params.get("password")): + return self.passwordless_signup(request.params) else: return super(SignupVerifyEmail, self).web_auth_signup(*args, **kw) @@ -29,17 +30,20 @@ def passwordless_signup(self, values): # Check good format of e-mail if not validate_email(values.get("login", "")): qcontext["error"] = _("That does not seem to be an email address.") - return http.request.render("auth_signup.signup", qcontext) + return request.render("auth_signup.signup", qcontext) elif not values.get("email"): values["email"] = values.get("login") + # preserve user lang + values['lang'] = request.lang + # Remove password values["password"] = "" - sudo_users = (http.request.env["res.users"] + sudo_users = (request.env["res.users"] .with_context(create_user=True).sudo()) try: - with http.request.cr.savepoint(): + with request.cr.savepoint(): sudo_users.signup(values, qcontext.get("token")) sudo_users.reset_password(values.get("login")) except Exception as error: @@ -49,7 +53,7 @@ def passwordless_signup(self, values): # Agnostic message for security qcontext["error"] = _( "Something went wrong, please try again later or contact us.") - return http.request.render("auth_signup.signup", qcontext) + return request.render("auth_signup.signup", qcontext) qcontext["message"] = _("Check your email to activate your account!") - return http.request.render("auth_signup.reset_password", qcontext) + return request.render("auth_signup.reset_password", qcontext) diff --git a/auth_signup_verify_email/tests/__init__.py b/auth_signup_verify_email/tests/__init__.py index 8858be4966..bed770df15 100644 --- a/auth_signup_verify_email/tests/__init__.py +++ b/auth_signup_verify_email/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2016 Jairo Llopis +# Copyright 2016 Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_verify_email diff --git a/auth_signup_verify_email/tests/test_verify_email.py b/auth_signup_verify_email/tests/test_verify_email.py index a3649cd7de..244535f321 100644 --- a/auth_signup_verify_email/tests/test_verify_email.py +++ b/auth_signup_verify_email/tests/test_verify_email.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- -# © 2016 Jairo Llopis +# Copyright 2016 Jairo Llopis # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from urllib import urlencode from lxml.html import document_fromstring -from openerp import _ -from openerp.tests.common import HttpCase +from odoo import _ +from odoo.tests.common import HttpCase +from odoo.tools.misc import mute_logger class UICase(HttpCase): @@ -39,9 +38,8 @@ def tearDown(self): def html_doc(self, url="/web/signup", data=None, timeout=10): """Get an HTML LXML document.""" - if data: - data = bytes(urlencode(data)) - return document_fromstring(self.url_open(url, data, timeout).read()) + resp = self.url_open(url, data=data, timeout=timeout) + return document_fromstring(resp.content) def csrf_token(self): """Get a valid CSRF token.""" @@ -58,6 +56,7 @@ def test_bad_email(self): doc = self.html_doc(data=self.data) self.assertTrue(self.search_text(doc, self.msg["badmail"])) + @mute_logger('odoo.addons.auth_signup_verify_email.controllers.main') def test_good_email(self): """Test acceptance of good emails. diff --git a/auth_signup_verify_email/views/signup.xml b/auth_signup_verify_email/views/signup.xml index cc81fcccf2..0a55571a4b 100644 --- a/auth_signup_verify_email/views/signup.xml +++ b/auth_signup_verify_email/views/signup.xml @@ -1,14 +1,14 @@ -