Fixed change password template/form.

This commit is contained in:
Lance Edgar 2013-09-10 20:37:19 -07:00
parent 6b5ca78a83
commit 857a4b88e5
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,15 @@
<%inherit file="/base.mako" />
<%def name="title()">Change Password</%def>
<div class="form">
${h.form(url('change_password'))}
${form.referrer_field()}
${form.field_div('current_password', form.password('current_password'))}
${form.field_div('new_password', form.password('new_password'))}
${form.field_div('confirm_password', form.password('confirm_password'))}
<div class="buttons">
${h.submit('submit', "Change Password")}
</div>
${h.end_form()}
</div>

View file

@ -97,7 +97,7 @@ class CurrentPasswordCorrect(formencode.validators.FancyValidator):
def _to_python(self, value, state): def _to_python(self, value, state):
user = state user = state
if not authenticate_user(user.username, value, session=Session()): if not authenticate_user(Session, user.username, value):
raise formencode.Invalid("The password is incorrect.", value, state) raise formencode.Invalid("The password is incorrect.", value, state)
return value return value