Ticket #11127: regex.diff
File regex.diff, 852 bytes (added by , 15 years ago) |
---|
-
django/contrib/auth/forms.py
56 56 Base class for authenticating users. Extend this to get a form that accepts 57 57 username/password logins. 58 58 """ 59 username = forms.CharField(label=_("Username"), max_length=30) 59 username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\w+$', 60 help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."), 61 error_message = _("This value must contain only letters, numbers and underscores.")) 60 62 password = forms.CharField(label=_("Password"), widget=forms.PasswordInput) 61 63 62 64 def __init__(self, request=None, *args, **kwargs):