Skip to content

Commit

Permalink
Fixed #13000 - Use a dictionary for the error messages definition in …
Browse files Browse the repository at this point in the history
…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
jezdez committed Mar 15, 2010
1 parent a03f675 commit 7989a78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django/contrib/auth/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
Expand Down Expand Up @@ -47,8 +47,8 @@ def save(self, commit=True):
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

Expand Down

0 comments on commit 7989a78

Please sign in to comment.