Fixed change password template/form.
This commit is contained in:
parent
6b5ca78a83
commit
857a4b88e5
15
tailbone/templates/change_password.mako
Normal file
15
tailbone/templates/change_password.mako
Normal 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>
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue