Author: jezdez Date: 2010-03-15 07:16:01 -0500 (Mon, 15 Mar 2010) New Revision: 12785
Modified: django/trunk/django/contrib/auth/forms.py Log: Fixed #13000 - Use a dictionary for the error messages definition in user creation and change form. Thanks for the patch, lgs. Modified: django/trunk/django/contrib/auth/forms.py =================================================================== --- django/trunk/django/contrib/auth/forms.py 2010-03-15 12:15:44 UTC (rev 12784) +++ django/trunk/django/contrib/auth/forms.py 2010-03-15 12:16:01 UTC (rev 12785) @@ -13,7 +13,7 @@ """ username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[...@+-]+$', 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 UserChangeForm(forms.ModelForm): username = forms.RegexField(label=_("Username"), max_length=30, regex=r'^[...@+-]+$', 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 -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.