Fix the "change password" form per Buefy theme
This commit is contained in:
parent
e04e67774e
commit
cd019fb05b
|
@ -1,13 +1,7 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/page.mako" />
|
||||
<%inherit file="/form.mako" />
|
||||
|
||||
<%def name="title()">Change Password</%def>
|
||||
|
||||
<%def name="page_content()">
|
||||
<div class="form">
|
||||
${form.render_deform()|n}
|
||||
</div>
|
||||
</%def>
|
||||
|
||||
|
||||
${parent.body()}
|
||||
|
|
|
@ -172,18 +172,15 @@ class AuthenticationView(View):
|
|||
if not self.request.user:
|
||||
return self.redirect(self.request.route_url('home'))
|
||||
|
||||
if self.rattail_config.demo() and self.request.user.username == 'chuck':
|
||||
self.request.session.flash("Cannot change password for 'chuck' in demo mode", 'error')
|
||||
return self.redirect(self.request.get_referrer())
|
||||
|
||||
use_buefy = self.get_use_buefy()
|
||||
schema = ChangePassword().bind(user=self.request.user)
|
||||
form = forms.Form(schema=schema, request=self.request)
|
||||
form = forms.Form(schema=schema, request=self.request, use_buefy=use_buefy)
|
||||
if form.validate(newstyle=True):
|
||||
set_user_password(self.request.user, form.validated['new_password'])
|
||||
self.request.session.flash("Your password has been changed.")
|
||||
return self.redirect(self.request.get_referrer())
|
||||
|
||||
return {'form': form}
|
||||
return {'form': form, 'use_buefy': use_buefy}
|
||||
|
||||
def become_root(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue