Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed auth to not use an internal implementation detail of SortedDict

  • Loading branch information...
commit 3e8d8bb094b9f765d94ac033b9135bcb81b816d2 1 parent 8f00286
Alex Gaynor authored July 14, 2012

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  django/contrib/auth/forms.py
9  django/contrib/auth/forms.py
@@ -3,6 +3,7 @@
3 3
 from django import forms
4 4
 from django.forms.util import flatatt
5 5
 from django.template import loader
  6
+from django.utils.datastructures import SortedDict
6 7
 from django.utils.html import format_html, format_html_join
7 8
 from django.utils.http import int_to_base36
8 9
 from django.utils.safestring import mark_safe
@@ -14,6 +15,7 @@
14 15
 from django.contrib.auth.tokens import default_token_generator
15 16
 from django.contrib.sites.models import get_current_site
16 17
 
  18
+
17 19
 UNMASKED_DIGITS_TO_SHOW = 6
18 20
 
19 21
 mask_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):
293 295
             raise forms.ValidationError(
294 296
                 self.error_messages['password_incorrect'])
295 297
         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
+])
298 303
 
299 304
 
300 305
 class AdminPasswordChangeForm(forms.Form):

0 notes on commit 3e8d8bb

Please sign in to comment.
Something went wrong with that request. Please try again.