You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.3 KiB

[REF] auth_signup_verify_email: Skip mail send in tests and use email_validator (#1247) This addon introduced an integration conflict when tested in a database that had `mail_tracking_mass_mailing` installed, producing this failure: Traceback (most recent call last): File "/opt/odoo/auto/addons/auth_signup_verify_email/controllers/main.py", line 44, in passwordless_signup sudo_users.reset_password(values.get("login")) File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__ self.gen.next() File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 419, in savepoint self.execute('RELEASE SAVEPOINT "%s"' % name) File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 154, in wrapper return f(self, *args, **kwargs) File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 231, in execute res = self._obj.execute(query, params) InternalError: no such savepoint Which in turn produced the following in the next test: InternalError: current transaction is aborted, commands ignored until end of transaction block The problem comes from the fact that one cannot rollback to a nested savepoint if the parent savepoint was released. It became a problem because that's the strategy that both this addon and upstream's `TestCursor` follow. To avoid that, tests now mock the `send_mail` method. This results also in having a predictable outcome from the test `test_good_email`, so it is more meaningful now. Besides, previously we were using the `validate_email` package, which is currently a dead project that can silently fail under certain environments, as seen in https://github.com/syrusakbary/validate_email/pull/80. There's the `email_validator` package, freely available, supported, and it provides a human-readable error message whenever some format from the email fails. As such, here I'm switching the dependency, while still adding a backwards compatibility layer for preexisting installations.
6 years ago
  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ======================
  5. Verify email at signup
  6. ======================
  7. This module extends the functionality of public sign up, and forces users to
  8. provide a valid email address.
  9. To achieve this requirement, the user does not need to provide a password at
  10. sign up, but when logging in later for the first time.
  11. Installation
  12. ============
  13. * Install validate_email_ with ``pip install validate_email`` or equivalent.
  14. Configuration
  15. =============
  16. To configure this module, you need to:
  17. * `Properly configure your outgoing email server(s)
  18. <https://www.odoo.com/es_ES/forum/help-1/question/how-to-configure-email-gateway-282#answer_290>`_.
  19. * Go to *Settings > General Settings* and enable *Allow
  20. external users to sign up*.
  21. Usage
  22. =====
  23. To use this module, you need to:
  24. * Log out.
  25. * `Sign up </web/signup>`_ with a valid email.
  26. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  27. :alt: Try me on Runbot
  28. :target: https://runbot.odoo-community.org/runbot/149/9.0
  29. Known issues / Roadmap
  30. ======================
  31. * Remove calls to ``cr.commit()`` in tests when
  32. https://github.com/odoo/odoo/issues/12237 gets fixed.
  33. * Drop support for ``validate_email`` in favor of ``email_validator``.
  34. Bug Tracker
  35. ===========
  36. Bugs are tracked on `GitHub Issues
  37. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  38. check there if your issue has already been reported. If you spotted it first,
  39. help us smashing it by providing a detailed and welcomed feedback.
  40. Credits
  41. =======
  42. Icon
  43. ----
  44. * https://openclipart.org/detail/3040/thumbtack-note-email
  45. * https://openclipart.org/detail/202732/check-mark
  46. Contributors
  47. ------------
  48. * Rafael Blasco <rafaelbn@antiun.com>
  49. * Jairo Llopis <yajo.sk8@gmail.com>
  50. Maintainer
  51. ----------
  52. .. image:: https://odoo-community.org/logo.png
  53. :alt: Odoo Community Association
  54. :target: https://odoo-community.org
  55. This module is maintained by the OCA.
  56. OCA, or the Odoo Community Association, is a nonprofit organization whose
  57. mission is to support the collaborative development of Odoo features and
  58. promote its widespread use.
  59. To contribute to this module, please visit https://odoo-community.org.
  60. .. _validate_email: https://pypi.python.org/pypi/validate_email