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

[FW][FIX] website : fix authenticate archived visitor #41203

Conversation

@fw-bot
Copy link
Contributor

fw-bot commented Dec 2, 2019

If a visitor logs in (and has a visitor_id in his cookie), the partner will be
linked to the visitor. If, after 1 week, the visitor tries to connect again
with a different session (or another visitor_id in cookies), the authenticate
will crash because:

  • _cron_archive_visitors applies on visitor inactive since at least a week
  • there can be only one visitor per partner (sql constraint)
  • The visitor linked to the partner is not retrieved (because archived) and
    we try to link the partner to a new visitor.

Further than that, if the visitor is archived and the linked partner wants to
login again with a new visitor_id, we should :

  • reactivate the previous visitor,
  • copy history from newest to previous one
  • delete the newest one

(last two points were already done before this commit).

This PR also fixes and simplifies the time_statistics computation.
As time_connection_datetime is always set and in the depends, no need to read
values before looping, the data is already fetched in memory. We can than
use directly the value for each visitor in self.

Task ID: 2120464

Forward-Port-Of: #40199

stdout:

stderr:
error: could not apply 33db89b... [FIX] website: fix authentication of archived visitor
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Dec 2, 2019

Ping @dbeguin, @tde-banana-odoo
Cherrypicking 33db89b of source #40199 failed

stderr:

error: could not apply 33db89b9e48... [FIX] website: fix authentication of archived visitor
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

@d-fence

This comment has been minimized.

Copy link
Contributor

d-fence commented Dec 3, 2019

@dbeguin Hello, this Forwardport is targeting master and was created before the freeze saas-13.1. This means that you have cherry-pick it in saas-13.1 and use the ignore command for the forward-port bot.

@dbeguin

This comment has been minimized.

Copy link
Contributor

dbeguin commented Dec 3, 2019

we have to*, I guess ?

@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo commented Dec 3, 2019

@fw-bot ignore

@tde-banana-odoo tde-banana-odoo deleted the odoo-dev:master-13.0-fix-visitor-authenticate-archive-dbe-wl7y-fw branch Dec 3, 2019
@robodoo robodoo added the closed 💔 label Dec 3, 2019
@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Dec 3, 2019

Forward-port disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.