mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Fixed #8379: the admin user change form now properly validates the username. Thanks, kratorius.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8544 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -43,6 +43,14 @@ class UserCreationForm(forms.ModelForm):
|
||||
user.save()
|
||||
return user
|
||||
|
||||
class UserChangeForm(forms.ModelForm):
|
||||
username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$',
|
||||
help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."),
|
||||
error_message = _("This value must contain only letters, numbers and underscores."))
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
|
||||
class AuthenticationForm(forms.Form):
|
||||
"""
|
||||
Base class for authenticating users. Extend this to get a form that accepts
|
||||
|
||||
Reference in New Issue
Block a user