[IMP] auth_signup: reset password form
* Hide 'back to login' when there is a token * Hide the form when the token is invalid
This commit is contained in:
committed by
Damien Bouvy
parent
53d064716b
commit
65d0faca4d
@@ -89,6 +89,7 @@ class AuthSignupHome(openerp.addons.web.controllers.main.Home):
|
||||
qcontext.setdefault(k, v)
|
||||
except:
|
||||
qcontext['error'] = _("Invalid signup token")
|
||||
qcontext['invalid_token'] = True
|
||||
return qcontext
|
||||
|
||||
def do_signup(self, qcontext):
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<form class="oe_reset_password_form" role="form" method="post" t-if="not message">
|
||||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
|
||||
|
||||
<t t-if="token">
|
||||
<t t-if="token and not invalid_token">
|
||||
<t t-call="auth_signup.fields">
|
||||
<t t-set="only_passwords" t-value="1"/>
|
||||
</t>
|
||||
@@ -90,7 +90,8 @@
|
||||
<input type="hidden" name="redirect" t-att-value="redirect"/>
|
||||
<input type="hidden" name="token" t-att-value="token"/>
|
||||
<div class="clearfix oe_login_buttons">
|
||||
<a t-attf-href="/web/login?{{ keep_query() }}" class="btn btn-link pull-right">Back to Login</a>
|
||||
<a t-if="not token" t-attf-href="/web/login?{{ keep_query() }}" class="btn btn-link pull-right">Back to Login</a>
|
||||
<a t-if="invalid_token" href="/web/login" class="btn btn-link pull-right">Back to Login</a>
|
||||
<button type="submit" class="btn btn-primary pull-left">Confirm</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user