summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-03-15 12:16:01 +0000
committerJannis Leidel <jannis@leidel.info>2010-03-15 12:16:01 +0000
commit7989a78baf2c613cc3b75b923f12d178c9bbeb08 (patch)
tree886ed980b60caa759ce995d016a84fe18581a477
parenta03f675876ee29a1e8035d138d23cd08aed9c082 (diff)
Fixed #13000 - Use a dictionary for the error messages definition in user creation and change form. Thanks for the patch, lgs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/auth/forms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index 5ffbc8207c..086acf3349 100644
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -13,7 +13,7 @@ class UserCreationForm(forms.ModelForm):
"""
username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
- error_message = _("This value may contain only letters, numbers and @/./+/-/_ characters."))
+ 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,
help_text = _("Enter the same password as above, for verification."))
@@ -47,8 +47,8 @@ class UserCreationForm(forms.ModelForm):
class UserChangeForm(forms.ModelForm):
username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
- error_message = _("This value may contain only letters, numbers and @/./+/-/_ characters."))
-
+ error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
+
class Meta:
model = User