From cd019fb05bb5b5dfee9a38e6ca9a8992be8d1ad8 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 23 Mar 2020 19:33:56 -0500 Subject: [PATCH] Fix the "change password" form per Buefy theme --- tailbone/templates/change_password.mako | 8 +------- tailbone/views/auth.py | 9 +++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/tailbone/templates/change_password.mako b/tailbone/templates/change_password.mako index 52cd55fd..c64acebf 100644 --- a/tailbone/templates/change_password.mako +++ b/tailbone/templates/change_password.mako @@ -1,13 +1,7 @@ ## -*- coding: utf-8; -*- -<%inherit file="/page.mako" /> +<%inherit file="/form.mako" /> <%def name="title()">Change Password -<%def name="page_content()"> -
- ${form.render_deform()|n} -
- - ${parent.body()} diff --git a/tailbone/views/auth.py b/tailbone/views/auth.py index d95ee9a5..2dd37e2c 100644 --- a/tailbone/views/auth.py +++ b/tailbone/views/auth.py @@ -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): """