Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed auth to not use an internal implementation detail of SortedDict

  • Loading branch information...
commit 3e8d8bb094b9f765d94ac033b9135bcb81b816d2 1 parent 8f00286
@alex alex authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 django/contrib/auth/forms.py
View
9 django/contrib/auth/forms.py
@@ -3,6 +3,7 @@
from django import forms
from django.forms.util import flatatt
from django.template import loader
+from django.utils.datastructures import SortedDict
from django.utils.html import format_html, format_html_join
from django.utils.http import int_to_base36
from django.utils.safestring import mark_safe
@@ -14,6 +15,7 @@
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.models import get_current_site
+
UNMASKED_DIGITS_TO_SHOW = 6
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):
raise forms.ValidationError(
self.error_messages['password_incorrect'])
return old_password
-PasswordChangeForm.base_fields.keyOrder = ['old_password', 'new_password1',
- 'new_password2']
+
+PasswordChangeForm.base_fields = SortedDict([
+ (k, PasswordChangeForm.base_fields[k])
+ for k in ['old_password', 'new_password1', 'new_password2']
+])
class AdminPasswordChangeForm(forms.Form):
Please sign in to comment.
Something went wrong with that request. Please try again.