Fix the "change password" form per Buefy theme

This commit is contained in:
Lance Edgar 2020-03-23 19:33:56 -05:00
parent e04e67774e
commit cd019fb05b
2 changed files with 4 additions and 13 deletions

View file

@ -1,13 +1,7 @@
## -*- coding: utf-8; -*- ## -*- coding: utf-8; -*-
<%inherit file="/page.mako" /> <%inherit file="/form.mako" />
<%def name="title()">Change Password</%def> <%def name="title()">Change Password</%def>
<%def name="page_content()">
<div class="form">
${form.render_deform()|n}
</div>
</%def>
${parent.body()} ${parent.body()}

View file

@ -172,18 +172,15 @@ class AuthenticationView(View):
if not self.request.user: if not self.request.user:
return self.redirect(self.request.route_url('home')) return self.redirect(self.request.route_url('home'))
if self.rattail_config.demo() and self.request.user.username == 'chuck': use_buefy = self.get_use_buefy()
self.request.session.flash("Cannot change password for 'chuck' in demo mode", 'error')
return self.redirect(self.request.get_referrer())
schema = ChangePassword().bind(user=self.request.user) 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): if form.validate(newstyle=True):
set_user_password(self.request.user, form.validated['new_password']) set_user_password(self.request.user, form.validated['new_password'])
self.request.session.flash("Your password has been changed.") self.request.session.flash("Your password has been changed.")
return self.redirect(self.request.get_referrer()) return self.redirect(self.request.get_referrer())
return {'form': form} return {'form': form, 'use_buefy': use_buefy}
def become_root(self): def become_root(self):
""" """