|
@@ -692,6 +692,18 @@ The following attributes and methods are available on any subclass of
|
|
|
Returns an HMAC of the password field. Used for
|
|
|
:ref:`session-invalidation-on-password-change`.
|
|
|
|
|
|
+:class:`~models.AbstractUser` subclasses :class:`~models.AbstractBaseUser`:
|
|
|
+
|
|
|
+.. class:: models.AbstractUser
|
|
|
+
|
|
|
+ .. method:: clean()
|
|
|
+
|
|
|
+ .. versionadded:: 1.11
|
|
|
+
|
|
|
+ Normalizes the email by calling
|
|
|
+ :meth:`.BaseUserManager.normalize_email`. If you override this method,
|
|
|
+ be sure to call ``super()`` to retain the normalization.
|
|
|
+
|
|
|
You should also define a custom manager for your ``User`` model. If your
|
|
|
``User`` model defines ``username``, ``email``, ``is_staff``, ``is_active``,
|
|
|
``is_superuser``, ``last_login``, and ``date_joined`` fields the same as
|
|
@@ -759,7 +771,7 @@ Extending Django's default ``User``
|
|
|
|
|
|
If you're entirely happy with Django's :class:`~django.contrib.auth.models.User`
|
|
|
model and you just want to add some additional profile information, you could
|
|
|
-simply subclass ``django.contrib.auth.models.AbstractUser`` and add your
|
|
|
+simply subclass :class:`django.contrib.auth.models.AbstractUser` and add your
|
|
|
custom profile fields, although we'd recommend a separate model as described in
|
|
|
the "Model design considerations" note of :ref:`specifying-custom-user-model`.
|
|
|
``AbstractUser`` provides the full implementation of the default
|