--- a/web/lib/django/contrib/auth/forms.py Wed May 19 17:43:59 2010 +0200
+++ b/web/lib/django/contrib/auth/forms.py Tue May 25 02:43:45 2010 +0200
@@ -11,11 +11,12 @@
"""
A form that creates a user, with no privileges, from the given username and password.
"""
- 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."))
+ username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
+ help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
+ error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
- password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput)
+ password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput,
+ help_text = _("Enter the same password as above, for verification."))
class Meta:
model = User
@@ -44,10 +45,10 @@
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."))
-
+ username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
+ help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
+ error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
+
class Meta:
model = User