Skip to content

[12.0][MIG] auth_signup_verify_email - #108

Merged
OCA-git-bot merged 7 commits into
OCA:12.0from
Tecnativa:12.0-mig-auth_signup_verify_email
Aug 21, 2019
Merged

OCA-git-bot merged 7 commits into
OCA:12.0from
Tecnativa:12.0-mig-auth_signup_verify_email

Conversation

@Tardo

@Tardo Tardo commented Jun 4, 2019

Copy link
Copy Markdown
Member

PR superseded: #69

cc @Tecnativa

@pedrobaeza
pedrobaeza requested a review from yajo June 4, 2019 12:58
@pedrobaeza pedrobaeza added this to the 12.0 milestone Jun 4, 2019
@pedrobaeza

Copy link
Copy Markdown
Member

What is the PR superseeded?

@Tardo

Tardo commented Jun 4, 2019

Copy link
Copy Markdown
Member Author

@pedrobaeza PR updated with the requested info.

@Tardo
Tardo force-pushed the 12.0-mig-auth_signup_verify_email branch from 5638970 to 026904a Compare June 4, 2019 13:20
@pedrobaeza

Copy link
Copy Markdown
Member

@ernestotejeda please review this PR

@chienandalu chienandalu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying a functional test but I get this error

test-auth

I'd say the problem comes from this view: https://github.com/OCA/server-auth/pull/108/files#diff-add74761757ad34e815f5cd9f9933f97R9

Comment thread auth_signup_verify_email/readme/CONFIGURE.rst Outdated
Comment thread auth_signup_verify_email/readme/INSTALL.rst Outdated
@Tardo

Tardo commented Jun 5, 2019

Copy link
Copy Markdown
Member Author

@chienandalu The problem is the SMTP configuration: https://github.com/OCA/server-auth/pull/108/files#diff-b76492f8c47aaeb881c43ddd50c764ccR67
'only_passwords' is used when you have a token, this token is sent via email to set the passwords.
Try using test@ñ0.com email, you can see that the form is sent correctly...

@ernestotejeda ernestotejeda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work great for me

  • Generate README.rst again after make the change i've proposed to include all the changes made in the readme fragment files
  • Squash to have a single migration commit

Comment thread auth_signup_verify_email/readme/CONFIGURE.rst

@chienandalu chienandalu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Tardo But even with a right smtp config and my email I'm not able to signup on the in the instance.

test-auth-2

@Tardo

Tardo commented Jun 5, 2019

Copy link
Copy Markdown
Member Author

@chienandalu can reproduce it on local?

@ernestotejeda

ernestotejeda commented Jun 5, 2019

Copy link
Copy Markdown
Member

It worked well for me on the runbot

@martintorresvm martintorresvm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM technical speaking. Waiting for functional approval of @chienandalu

@mohamedhagag

Copy link
Copy Markdown

it's working fine with me .

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Rebased to 12.0-ocabot-merge-pr-108-by-pedrobaeza-bump-no, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@pedrobaeza Merge command aborted due to a failed check on 12.0-ocabot-merge-pr-108-by-pedrobaeza-bump-no.

@pedrobaeza

Copy link
Copy Markdown
Member

@Tardo please check the problem in Travis on the rebased branch.

@Tardo

Tardo commented Jul 8, 2019

Copy link
Copy Markdown
Member Author

@pedrobaeza it's a incompatibility with 'auth_oauth' module.. these module doesn't modify the qcontext properly... https://github.com/odoo/odoo/blob/12.0/addons/auth_oauth/controllers/main.py#L116
I made a "hack" to prevent crashes.

@Tardo
Tardo force-pushed the 12.0-mig-auth_signup_verify_email branch from ce8890a to bfd4ca2 Compare July 8, 2019 16:52
@yajo

yajo commented Jul 9, 2019

Copy link
Copy Markdown
Member

these module doesn't modify the qcontext properly

What's wrong there? 🤔

@Tardo

Tardo commented Jul 9, 2019

Copy link
Copy Markdown
Member Author

@yajo the correct place to modify the qcontext is here: https://github.com/odoo/odoo/blob/11.0/addons/auth_signup/controllers/main.py#L101
If you change the xml and modify the qcontext in 'web_auth_signup' the view will broke if you don't use "super"...

@yajo yajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened odoo/odoo#34690 so please link it in the hacks, and let's see if in the future we can remove the HACK.

Comment thread auth_signup_verify_email/controllers/main.py Outdated
Comment thread auth_signup_verify_email/controllers/main.py Outdated
Comment thread auth_signup_verify_email/controllers/main.py
Comment thread auth_signup_verify_email/readme/CONFIGURE.rst
Comment thread auth_signup_verify_email/tests/test_verify_email.py Outdated
Comment thread auth_signup_verify_email/tests/test_verify_email.py Outdated
@Tardo
Tardo force-pushed the 12.0-mig-auth_signup_verify_email branch from b01b8e5 to 749cb9d Compare July 16, 2019 16:23
@MiquelRForgeFlow

Copy link
Copy Markdown
Contributor

conflicts! rebase please

* 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.
@Tardo
Tardo force-pushed the 12.0-mig-auth_signup_verify_email branch from 749cb9d to a148f1e Compare August 14, 2019 20:27
@Tardo

Tardo commented Aug 14, 2019

Copy link
Copy Markdown
Member Author

@mreficent rebased, thanks!

@pedrobaeza

Copy link
Copy Markdown
Member

@yajo, please re-review

@rafaelbn rafaelbn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing technical final review of @yajo

But, functionally 👍

@yajo

yajo commented Aug 21, 2019

Copy link
Copy Markdown
Member

Please squash the migration-related commits.

Comment thread auth_signup_verify_email/__manifest__.py
@Tardo
Tardo force-pushed the 12.0-mig-auth_signup_verify_email branch from a148f1e to 3738c55 Compare August 21, 2019 18:02
@Tardo

Tardo commented Aug 21, 2019

Copy link
Copy Markdown
Member Author

@yajo done!

sharkende and others added 6 commits August 21, 2019 20:31
* Module set to installable
* Odoo don't let signup without password
…ts and use email_validator (OCA#29)

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 syrusakbary/validate_email#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.
* When try to login with a not valid email domain it raised a 500 server
  error. Now we shwt the proper message "The domain name <domain> does not
  exist."
* If there is any error we do not have catched when we do the email
  validation then we manage it and show the error message to the user instead
  of 500 server error.
* When we try to register with a already registered email it raise "Something
  went wrong, please try again later or contact us". Now shows the message
  as odoo regular signup does: "Another user is already registered using this
  email address" which is more specific and clear for this case.
@pedrobaeza
pedrobaeza force-pushed the 12.0-mig-auth_signup_verify_email branch from 3738c55 to 64a3827 Compare August 21, 2019 18:33
@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Rebased to 12.0-ocabot-merge-pr-108-by-pedrobaeza-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Aug 21, 2019
Signed-off-by pedrobaeza
@OCA-git-bot
OCA-git-bot merged commit 64a3827 into OCA:12.0 Aug 21, 2019
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at df1f6d9. Thanks a lot for contributing to OCA. ❤️

PS: Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged into 12.0.

@yajo
yajo deleted the 12.0-mig-auth_signup_verify_email branch August 29, 2019 07:42
SiesslPhillip pushed a commit to grueneerde/OCA-server-auth that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-auth (12.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.