Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 7989a78baf2c613cc3b75b923f12d178c9bbeb08 1 parent a03f675
Jannis Leidel authored March 15, 2010

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/contrib/auth/forms.py
6  django/contrib/auth/forms.py
@@ -13,7 +13,7 @@ class UserCreationForm(forms.ModelForm):
13 13
     """
14 14
     username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
15 15
         help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
16  
-        error_message = _("This value may contain only letters, numbers and @/./+/-/_ characters."))
  16
+        error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
17 17
     password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
18 18
     password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput,
19 19
         help_text = _("Enter the same password as above, for verification."))
@@ -47,8 +47,8 @@ def save(self, commit=True):
47 47
 class UserChangeForm(forms.ModelForm):
48 48
     username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[\w.@+-]+$',
49 49
         help_text = _("Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only."),
50  
-        error_message = _("This value may contain only letters, numbers and @/./+/-/_ characters."))
51  
-    
  50
+        error_messages = {'invalid': _("This value may contain only letters, numbers and @/./+/-/_ characters.")})
  51
+
52 52
     class Meta:
53 53
         model = User
54 54
 

0 notes on commit 7989a78

Please sign in to comment.
Something went wrong with that request. Please try again.