Merge lp:~openerp-dev/openobject-addons/7.0-opw-598453-msh into lp:openobject-addons/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-598453-msh
Merge into: lp:openobject-addons/7.0
Diff against target: 29 lines (+7/-6)
1 file modified
auth_signup/static/src/js/auth_signup.js (+7/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-598453-msh
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) Pending
Naresh(OpenERP) Pending
Review via email: mp+190529@code.launchpad.net

Description of the change

Hello,

Issue with auth_signup, when unregistered user opens URL provided him in email, like when one sends an invitation and that subscription link when opened it shows signin page randomly instead of Signup page.

Demo: 1. From Sales Module, created a customer (provided only the “Name”, checked “Is a Company?”)
2. Created new contact for the customer (provided email address, left unchecked “Is a Company?”)
3. From “More” option of the newly created contact, selected “Portal Access Management”, checked “In Portal”, and clicked apply.
4. Checking Settings>Users, the newly created contact appeared on the list.
5. Checking the newly created contact’s email, it received the email notification “You have given access to Portal…”, with login account data and the URL to complete the sign-in process.
6. Clicking the URL, it directs sign in page instead of sign-up:

Reason is due to sequence of execution, config data should be retrieved first and then auth_signup user information, get_config is going to be called for all user, whether it is opened with token infomration or without it, so it should not override the data which retirived by token URL.

Thanks.

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

The problem is in the order but mostly because of concurrent calls. To avoid unpredictable results, I used .then() calls. I reject this merge prop.

Another solution was merged at revision 9601

Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello Martin,

You really don't need to reject this branch, the code did here is same as you did in revision 9601, you used .then handler instead of done, even if you did not use .then and just paste the call of retrieve in .done callback then also it work, the basic difference in done and then is done is called when deferred is resolved and .then when deferred is either resolved or rejected.

So I think to fix this what was needed is: just put the retrieve call inside done callback.

Yes Issue was raised due to concurrent call and returned unpredictable result but kipping retrieve call in done handler will resolve the issue.

Correct me if I am wrong.

Thanks for you review.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'auth_signup/static/src/js/auth_signup.js'
2--- auth_signup/static/src/js/auth_signup.js 2013-05-27 14:18:45 +0000
3+++ auth_signup/static/src/js/auth_signup.js 2013-10-11 05:02:42 +0000
4@@ -39,12 +39,6 @@
5 delete self.params.error_message;
6 }
7
8- // in case of a signup, retrieve the user information from the token
9- if (dbname && self.params.token) {
10- self.rpc("/auth_signup/retrieve", {dbname: dbname, token: self.params.token})
11- .done(self.on_token_loaded)
12- .fail(self.on_token_failed);
13- }
14 if (dbname && self.params.login) {
15 self.$("form input[name=login]").val(self.params.login);
16 }
17@@ -66,6 +60,13 @@
18 // TODO: support multiple database mode
19 self.set('login_mode', 'default');
20 }
21+
22+ // in case of a signup, retrieve the user information from the token
23+ if (dbname && self.params.token) {
24+ self.rpc("/auth_signup/retrieve", {dbname: dbname, token: self.params.token})
25+ .done(self.on_token_loaded)
26+ .fail(self.on_token_failed);
27+ }
28 });
29 },
30