summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2016-08-28 17:19:50 -0700
committerGitHub <noreply@github.com>2016-08-28 17:19:50 -0700
commitae98d40c358af2e14bac03d9a3a2dc99701aa13a (patch)
tree3c477145ccdd2fe3edd11f8247ebac37549d77b6 /django
parent38cf9ef390eb0cd0703d99893f826153865f6ba6 (diff)
downloaddjango-ae98d40c358af2e14bac03d9a3a2dc99701aa13a.tar.gz
Fixed #27136 -- Changed auth forms' autofocus attribute to HTML5 boolean syntax.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/forms.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index c75d988c2f..b1dd713937 100644
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -95,7 +95,7 @@ class UserCreationForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(UserCreationForm, self).__init__(*args, **kwargs)
if self._meta.model.USERNAME_FIELD in self.fields:
- self.fields[self._meta.model.USERNAME_FIELD].widget.attrs.update({'autofocus': ''})
+ self.fields[self._meta.model.USERNAME_FIELD].widget.attrs.update({'autofocus': True})
def clean_password2(self):
password1 = self.cleaned_data.get("password1")
@@ -152,7 +152,7 @@ class AuthenticationForm(forms.Form):
"""
username = UsernameField(
max_length=254,
- widget=forms.TextInput(attrs={'autofocus': ''}),
+ widget=forms.TextInput(attrs={'autofocus': True}),
)
password = forms.CharField(
label=_("Password"),
@@ -347,7 +347,7 @@ class PasswordChangeForm(SetPasswordForm):
old_password = forms.CharField(
label=_("Old password"),
strip=False,
- widget=forms.PasswordInput(attrs={'autofocus': ''}),
+ widget=forms.PasswordInput(attrs={'autofocus': True}),
)
field_order = ['old_password', 'new_password1', 'new_password2']
@@ -375,7 +375,7 @@ class AdminPasswordChangeForm(forms.Form):
required_css_class = 'required'
password1 = forms.CharField(
label=_("Password"),
- widget=forms.PasswordInput(attrs={'autofocus': ''}),
+ widget=forms.PasswordInput(attrs={'autofocus': True}),
strip=False,
help_text=password_validation.password_validators_help_text_html(),
)