-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[IMP] survey: add link to create account in access error page #99299
base: master
Are you sure you want to change the base?
[IMP] survey: add link to create account in access error page #99299
Conversation
a9770b0
to
e90e797
Compare
397f08e
to
a01dd33
Compare
<t t-if="signup_url and login_url"> | ||
Please <a t-att-href="login_url">Log in</a> or <a t-att-href="signup_url">Create an account</a>. | ||
</t> | ||
<t t-elif="login_url"> | ||
Please <a t-att-href="login_url">Log in</a>. | ||
</t> | ||
<t t-elif="signup_url"> | ||
Please <a t-att-href="signup_url">Create an account</a>. | ||
</t> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could reduce a bit by doing this
<t t-if="signup_url or login_url">
Please
<a t-if="login_url" t-att-href="login_url">Log in</a>
<span t-if="login_url and signup_url">or</span>
<a t-if="signup_url" t-att-href="signup_url">Create an account</a>
</t>
<t-else...
""" If an answer_token exists and no partner is linked, and login in is now required, associate the existing answer to the | ||
newly connected / created partner when going back to the survey, by the intermediate of this route. Redirects to the survey | ||
start route afterwards. This prevents losing the current answer, and that answer to pollute the survey answers.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need some unit tests
a01dd33
to
cf66a64
Compare
When there is an authorization issue, the user sees a message inviting him to log in, for surveys where it is required to be logged in. According to the situation, the public user could also be invited to create an account, if the option is available. Therefore, we go from "Please Log in" to "Please Log in or Create an account" or just "Please create an account" when the user should be connected but is not, (depending on whether the current partner has users, on whether there is already an user_input, for instance in the cookies, ...) If a direct invitation to a partner is clicked and the login is required, then if that partner has no linked user, and no free sign up is allowed in the general settings, they will not be abled to access the survey. Therefore, display "Please contact an administrator to create an account" instead. The case of an public user having started the survey but the login going from non required to required is also dealt with. This is done to avoid having leftover user_inputs that are lost and unusable. A new route called 'link_partner' is used to link the started answer to the partner created OR logged in after being redirected from the error page. On signing up / logging in, the user will be redirected to the survey they were taking before. They can continue their answer and it is linked correctly in the back end. The method handling errors is also used when using the /print route. This means that we could have a different partner_id between logged user and the one who took the survey. To avoid any issue, we only ask the user to log in in that case (no prepared login). The template and controller method are updated accordingly. Task-2925443
cf66a64
to
670e50c
Compare
Dear @Odoonan, Thank you for your contribution but we are closing it due to inactivity. We apology if we could not look at your request in time. This is an automated message. |
Task on pause, not canceled |
When there is an authorization issue, the user sees a message inviting
him to log in, for surveys where it is required to be logged in.
According to the situation, the public user could also be invited to
create an account, if the option is available. Therefore, we go from
"Please Log in" to "Please Log in or Create an account" or just
"Please create an account" when the user should be connected but is not,
(depending on whether the current partner has users, on whether there is
already an user_input, for instance in the cookies, ...)
The template and controller method are updated accordingly.
Task-2925443