From 49af00e491a7ec6b920a3780254f2203ae47fbe5 Mon Sep 17 00:00:00 2001 From: Elrond Date: Thu, 5 Jan 2012 14:47:15 +0100 Subject: [PATCH] Make show-password-js work for change password too The show password js depends on the password field to have an id of "password". So give it a proper id. Also fixed the label generation for the case of field.name and field.id being different. --- mediagoblin/edit/forms.py | 3 ++- mediagoblin/templates/mediagoblin/utils/wtforms.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mediagoblin/edit/forms.py b/mediagoblin/edit/forms.py index df219011..09955874 100644 --- a/mediagoblin/edit/forms.py +++ b/mediagoblin/edit/forms.py @@ -64,7 +64,8 @@ class EditAccountForm(wtforms.Form): new_password = wtforms.PasswordField( _('New password'), [wtforms.validators.Required(), - wtforms.validators.Length(min=6, max=30)]) + wtforms.validators.Length(min=6, max=30)], + id="password") class EditAttachmentsForm(wtforms.Form): diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 3517b5c3..44b27bb8 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -19,7 +19,7 @@ {# Generically render a field #} {% macro render_field_div(field) %} {% if field.label.text -%} -

+

{%- endif %}
{{ field }} -- 2.25.1