Ticket #23948: password_help.patch

File password_help.patch, 4.7 KB (added by James McMahon, 9 years ago)

patch which acheives the described behaviour

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

    From 19e3bc6223d2005ff3114f39340040a18d4537f7 Mon Sep 17 00:00:00 2001
    From: James McMahon <james1345@googlemail.com>
    Date: Wed, 19 Nov 2014 14:42:25 +0000
    Subject: [PATCH 1/2] Changed password templates to use the help text supplied
     in the form definition
    
    ---
     django/contrib/admin/templates/admin/auth/user/change_password.html   | 3 ++-
     django/contrib/admin/templates/registration/password_change_form.html | 2 ++
     django/contrib/auth/forms.py                                          | 3 ++-
     3 files changed, 6 insertions(+), 2 deletions(-)
    
    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..7fb7b55 100644
    a b  
    3535<div class="form-row">
    3636  {{ form.password1.errors }}
    3737  {{ form.password1.label_tag }} {{ form.password1 }}
     38  <p class="help">{{ form.password1.help_text }}</p>
    3839</div>
    3940
    4041<div class="form-row">
    4142  {{ form.password2.errors }}
    4243  {{ form.password2.label_tag }} {{ form.password2 }}
    43   <p class="help">{% trans 'Enter the same password as above, for verification.' %}</p>
     44  <p class="help">{{ form.password2.help_text }}</p>
    4445</div>
    4546
    4647</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..78b46a6 100644
    a b  
    3535<div class="form-row">
    3636    {{ form.new_password1.errors }}
    3737    {{ form.new_password1.label_tag }} {{ form.new_password1 }}
     38        <p class="help">{{ form.new_password1.help_text }}</p>
    3839</div>
    3940
    4041<div class="form-row">
    4142{{ form.new_password2.errors }}
    4243    {{ form.new_password2.label_tag }} {{ form.new_password2 }}
     44        <p class="help">{{ form.new_password2.help_text }}</p>
    4345</div>
    4446
    4547</fieldset>
  • django/contrib/auth/forms.py

    diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
    index c54a086..b982674 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
  • django/contrib/admin/templates/registration/password_change_form.html

    -- 
    1.9.4.msysgit.2
    
    
    From f76d2946d5f8c5368fc26b045e6f72668abd59c7 Mon Sep 17 00:00:00 2001
    From: James McMahon <james1345@googlemail.com>
    Date: Wed, 19 Nov 2014 14:45:50 +0000
    Subject: [PATCH 2/2] changed tabs to spaces
    
    ---
     django/contrib/admin/templates/registration/password_change_form.html | 4 ++--
     django/contrib/auth/forms.py                                          | 2 +-
     2 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html
    index 78b46a6..aaa2009 100644
    a b  
    3535<div class="form-row">
    3636    {{ form.new_password1.errors }}
    3737    {{ form.new_password1.label_tag }} {{ form.new_password1 }}
    38         <p class="help">{{ form.new_password1.help_text }}</p>
     38    <p class="help">{{ form.new_password1.help_text }}</p>
    3939</div>
    4040
    4141<div class="form-row">
    4242{{ form.new_password2.errors }}
    4343    {{ form.new_password2.label_tag }} {{ form.new_password2 }}
    44         <p class="help">{{ form.new_password2.help_text }}</p>
     44    <p class="help">{{ form.new_password2.help_text }}</p>
    4545</div>
    4646
    4747</fieldset>
  • django/contrib/auth/forms.py

    diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
    index b982674..7aad16c 100644
    a b class AdminPasswordChangeForm(forms.Form):  
    341341                                widget=forms.PasswordInput)
    342342    password2 = forms.CharField(label=_("Password (again)"),
    343343                                widget=forms.PasswordInput,
    344                                                                 help_text=_("Enter the same password as above, for verification.")
     344                                help_text=_("Enter the same password as above, for verification.")
    345345
    346346    def __init__(self, user, *args, **kwargs):
    347347        self.user = user
Back to Top