File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 33from django import forms
44from django .forms .util import flatatt
55from django .template import loader
6+ from django .utils .datastructures import SortedDict
67from django .utils .html import format_html , format_html_join
78from django .utils .http import int_to_base36
89from django .utils .safestring import mark_safe
1415from django .contrib .auth .tokens import default_token_generator
1516from django .contrib .sites .models import get_current_site
1617
18+
1719UNMASKED_DIGITS_TO_SHOW = 6
1820
1921mask_password = lambda p : "%s%s" % (p [:UNMASKED_DIGITS_TO_SHOW ], "*" * max (len (p ) - UNMASKED_DIGITS_TO_SHOW , 0 ))
@@ -293,8 +295,11 @@ def clean_old_password(self):
293295 raise forms .ValidationError (
294296 self .error_messages ['password_incorrect' ])
295297 return old_password
296- PasswordChangeForm .base_fields .keyOrder = ['old_password' , 'new_password1' ,
297- 'new_password2' ]
298+
299+ PasswordChangeForm .base_fields = SortedDict ([
300+ (k , PasswordChangeForm .base_fields [k ])
301+ for k in ['old_password' , 'new_password1' , 'new_password2' ]
302+ ])
298303
299304
300305class AdminPasswordChangeForm (forms .Form ):
You can’t perform that action at this time.
0 commit comments