summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorVincenzo Pandolfo <pandolfovince@gmail.com>2016-03-14 20:21:05 +0000
committerTim Graham <timograham@gmail.com>2016-03-14 20:24:19 -0400
commitc6424efbc6114eeefe7ec7545de7e127ed189e92 (patch)
tree40fbd706c200913814c4be6837940dffeef23da6 /django
parentb50e4ffe7eb9d8797d38f28ae3f51fb443056214 (diff)
[1.9.x] Fixed #26334 -- Removed whitespace stripping from contrib.auth password fields.
Backport of d0fe6c915665fa3220e84bd691ba7002a357e5c5 from master
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/forms.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index b1cedc916c..380dc2b001 100644
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -69,9 +69,11 @@ class UserCreationForm(forms.ModelForm):
'password_mismatch': _("The two password fields didn't match."),
}
password1 = forms.CharField(label=_("Password"),
+ strip=False,
widget=forms.PasswordInput)
password2 = forms.CharField(label=_("Password confirmation"),
widget=forms.PasswordInput,
+ strip=False,
help_text=_("Enter the same password as before, for verification."))
class Meta:
@@ -127,7 +129,7 @@ class AuthenticationForm(forms.Form):
username/password logins.
"""
username = forms.CharField(max_length=254)
- password = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
+ password = forms.CharField(label=_("Password"), strip=False, widget=forms.PasswordInput)
error_messages = {
'invalid_login': _("Please enter a correct %(username)s and password. "
@@ -269,8 +271,10 @@ class SetPasswordForm(forms.Form):
}
new_password1 = forms.CharField(label=_("New password"),
widget=forms.PasswordInput,
+ strip=False,
help_text=password_validation.password_validators_help_text_html())
new_password2 = forms.CharField(label=_("New password confirmation"),
+ strip=False,
widget=forms.PasswordInput)
def __init__(self, user, *args, **kwargs):
@@ -307,6 +311,7 @@ class PasswordChangeForm(SetPasswordForm):
"Please enter it again."),
})
old_password = forms.CharField(label=_("Old password"),
+ strip=False,
widget=forms.PasswordInput)
field_order = ['old_password', 'new_password1', 'new_password2']
@@ -335,11 +340,13 @@ class AdminPasswordChangeForm(forms.Form):
password1 = forms.CharField(
label=_("Password"),
widget=forms.PasswordInput,
+ strip=False,
help_text=password_validation.password_validators_help_text_html(),
)
password2 = forms.CharField(
label=_("Password (again)"),
widget=forms.PasswordInput,
+ strip=False,
help_text=_("Enter the same password as before, for verification."),
)