Ticket #11676: username_regex_patch.diff
File username_regex_patch.diff, 1.2 KB (added by , 15 years ago) |
---|
-
django/contrib/auth/forms.py
11 11 """ 12 12 A form that creates a user, with no privileges, from the given username and password. 13 13 """ 14 username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\ w+$',14 username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\S+$', 15 15 help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."), 16 16 error_message = _("This value must contain only letters, numbers and underscores.")) 17 17 password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput) … … 44 44 return user 45 45 46 46 class UserChangeForm(forms.ModelForm): 47 username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\ w+$',47 username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^\S+$', 48 48 help_text = _("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."), 49 49 error_message = _("This value must contain only letters, numbers and underscores.")) 50 50