1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

[1.5.x] Fixed #19822 -- Added validation for uniqueness on USERNAME_FIELD on custom User models.

Thanks to Claude Peroz for the draft patch.

(cherry picked from commit f5e4a699ca)
This commit is contained in:
Russell Keith-Magee
2013-02-15 09:00:55 +08:00
parent 1c086df50e
commit bc6746ac30
4 changed files with 49 additions and 2 deletions

View File

@@ -486,7 +486,10 @@ password resets. You must then provide some key implementation details:
A string describing the name of the field on the User model that is
used as the unique identifier. This will usually be a username of
some kind, but it can also be an email address, or any other unique
identifier. In the following example, the field `identifier` is used
identifier. The field *must* be unique (i.e., have ``unique=True``
set in it's definition).
In the following example, the field `identifier` is used
as the identifying field::
class MyUser(AbstractBaseUser):