mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +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:
@@ -181,4 +181,13 @@ True
|
||||
>>> PasswordChangeForm(user, {}).fields.keys()
|
||||
['old_password', 'new_password1', 'new_password2']
|
||||
|
||||
### UserChangeForm
|
||||
|
||||
>>> from django.contrib.auth.forms import UserChangeForm
|
||||
>>> data = {'username': 'not valid'}
|
||||
>>> form = UserChangeForm(data, instance=user)
|
||||
>>> form.is_valid()
|
||||
False
|
||||
>>> form['username'].errors
|
||||
[u'This value must contain only letters, numbers and underscores.']
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user