Author: aaugustin Date: 2011-12-17 07:30:55 -0800 (Sat, 17 Dec 2011) New Revision: 17225
Modified: django/trunk/django/contrib/auth/forms.py Log: Explained why UserCreationForm performs custom validation of usernames. Refs #13147. Modified: django/trunk/django/contrib/auth/forms.py =================================================================== --- django/trunk/django/contrib/auth/forms.py 2011-12-17 10:27:14 UTC (rev 17224) +++ django/trunk/django/contrib/auth/forms.py 2011-12-17 15:30:55 UTC (rev 17225) @@ -69,6 +69,8 @@ fields = ("username",) def clean_username(self): + # Since User.username is unique, this check is redundant, + # but it sets a nicer error message than the ORM. See #13147. username = self.cleaned_data["username"] try: User.objects.get(username=username) -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@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.