Commit 271d4f8f authored by Tim Graham's avatar Tim Graham
Browse files

Fixed #23948 -- Moved password help text from the template to the form.

Thanks Mithos for the report and patch.
parent 3325ec86
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -35,12 +35,17 @@
<div class="form-row">
  {{ form.password1.errors }}
  {{ form.password1.label_tag }} {{ form.password1 }}
  {% if form.password1.help_text %}
  <p class="help">{{ form.password1.help_text }}</p>
  {% endif %}
</div>

<div class="form-row">
  {{ form.password2.errors }}
  {{ form.password2.label_tag }} {{ form.password2 }}
  <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p>
  {% if form.password2.help_text %}
  <p class="help">{{ form.password2.help_text }}</p>
  {% endif %}
</div>

</fieldset>
+6 −0
Original line number Diff line number Diff line
@@ -35,11 +35,17 @@
<div class="form-row">
    {{ form.new_password1.errors }}
    {{ form.new_password1.label_tag }} {{ form.new_password1 }}
    {% if form.new_password1.help_text %}
    <p class="help">{{ form.new_password1.help_text }}</p>
    {% endif %}
</div>

<div class="form-row">
{{ form.new_password2.errors }}
    {{ form.new_password2.label_tag }} {{ form.new_password2 }}
    {% if form.new_password2.help_text %}
    <p class="help">{{ form.new_password2.help_text }}</p>
    {% endif %}
</div>

</fieldset>
+9 −4
Original line number Diff line number Diff line
@@ -337,10 +337,15 @@ class AdminPasswordChangeForm(forms.Form):
        'password_mismatch': _("The two password fields didn't match."),
    }
    required_css_class = 'required'
    password1 = forms.CharField(label=_("Password"),
                                widget=forms.PasswordInput)
    password2 = forms.CharField(label=_("Password (again)"),
                                widget=forms.PasswordInput)
    password1 = forms.CharField(
        label=_("Password"),
        widget=forms.PasswordInput,
    )
    password2 = forms.CharField(
        label=_("Password (again)"),
        widget=forms.PasswordInput,
        help_text=_("Enter the same password as above, for verification."),
    )

    def __init__(self, user, *args, **kwargs):
        self.user = user