-
- Downloads
[FIX] survey: Avoid forbidding access to survey when the answer cookie...
[FIX] survey: Avoid forbidding access to survey when the answer cookie corresponds to no actual answer
To reproduce:
1) Create a survey and open it with a portal user with its /survey/start/*** link
2) In a private window, connect as the admin and remove the answer in 'Not started yet' state that step 1 created.
3) Go back to your portal user window and re-enter the same /survey/start/*** URL.
==> The portal user is brought back to the home page. He has no way to access the survey anymore, the link will always redirect him there.
This is because of cookies. The first time the user opens the survey, it creates a cookie in his browser allowing him to reload the answer he was working on. In our example, this answer has been deleted for some reason (maybe some cleaning of too old 'not started' or 'in progress' stuff); so the token stored in the cookie does not correspond to anything anymore. Instead of crashing and redirecting to home page, this commit makes it so that we now ignore the cookie in that case, so that the user directly has access to the survey to build a new answer.
Task-2729738
closes odoo/odoo#82041
Signed-off-by:
Thibault Delavallee (tde) <tde@openerp.com>
Please register or sign in to comment