Ticket #23948: password_help_improved.patch

File password_help_improved.patch, 2.4 KB (added by Bibhas C Debnath, 10 years ago)

Last patch had a syntax error(an unclosed bracket). Fixed that and only showing help_text <p> tag if a help_text is available.

  • django/contrib/admin/templates/admin/auth/user/change_password.html

    diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html
    index 8bbc448..bfffd2a 100644
    a b  
    3535<div class="form-row">
    3636  {{ form.password1.errors }}
    3737  {{ form.password1.label_tag }} {{ form.password1 }}
     38  {% if form.password1.help_text %}
     39  <p class="help">{{ form.password1.help_text }}</p>
     40  {% endif %}
    3841</div>
    3942
    4043<div class="form-row">
    4144  {{ form.password2.errors }}
    4245  {{ form.password2.label_tag }} {{ form.password2 }}
    43   <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p>
     46  {% if form.password2.help_text %}
     47  <p class="help">{{ form.password2.help_text }}</p>
     48  {% endif %}
    4449</div>
    4550
    4651</fieldset>
  • django/contrib/admin/templates/registration/password_change_form.html

    diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html
    index 6c1118d..1e641dc 100644
    a b  
    3535<div class="form-row">
    3636    {{ form.new_password1.errors }}
    3737    {{ form.new_password1.label_tag }} {{ form.new_password1 }}
     38    {% if form.new_password1.help_text %}
     39    <p class="help">{{ form.new_password1.help_text }}</p>
     40    {% endif %}
    3841</div>
    3942
    4043<div class="form-row">
    4144{{ form.new_password2.errors }}
    4245    {{ form.new_password2.label_tag }} {{ form.new_password2 }}
     46    {% if form.new_password2.help_text %}
     47    <p class="help">{{ form.new_password2.help_text }}</p>
     48    {% endif %}
    4349</div>
    4450
    4551</fieldset>
  • django/contrib/auth/forms.py

    diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
    index 86cfa29..c14b8f8 100644
    a b class AdminPasswordChangeForm(forms.Form):  
    340340    password1 = forms.CharField(label=_("Password"),
    341341                                widget=forms.PasswordInput)
    342342    password2 = forms.CharField(label=_("Password (again)"),
    343                                 widget=forms.PasswordInput)
     343                                widget=forms.PasswordInput,
     344                                help_text=_("Enter the same password as above, for verification."))
    344345
    345346    def __init__(self, user, *args, **kwargs):
    346347        self.user = user
Back to Top