def web_login(self, *args, **kw):
mode = request.params.get('mode')
qcontext = request.params.copy()
- super_response = super(AuthSignup, self).web_login(*args, **kw)
+ super_response = None
+ if request.httprequest.method != 'POST' or mode not in ('reset', 'signup'):
+ # Default behavior is to try to login, which in reset or signup mode in a non-sense.
+ super_response = super(AuthSignup, self).web_login(*args, **kw)
- response = webmain.render_bootstrap_template(request.session.db, 'auth_signup.signup', qcontext, lazy=True)
- if isinstance(super_response, LazyResponse):
- response.params['values'].update(super_response.params['values'])
+ response = webmain.render_bootstrap_template('auth_signup.signup', qcontext)
+ if super_response.is_qweb:
+ response.qcontext.update(super_response.qcontext)
token = qcontext.get('token', None)
token_infos = None
if token:
}
qcontext.update(config)
- if 'error' in qcontext or mode not in ('reset', 'signup') or (not token and not config[mode]):
+ if 'error' in request.params or mode not in ('reset', 'signup') or (not token and not config[mode]):
- if isinstance(super_response, LazyResponse):
- super_response.params['values'].update(config)
+ if super_response.is_qweb:
+ super_response.qcontext.update(config)
return super_response
if request.httprequest.method == 'GET':