1
0
mirror of https://github.com/django/django.git synced 2025-03-13 10:50:55 +00:00

[5.1.x] Doc'd that unusable passwords are defined by metadata in the password field.

Backport of de2bb73904009313bae3664ef71edfd60df9912b from main.
This commit is contained in:
David D Lowe 2024-10-23 18:20:36 +01:00 committed by Natalia
parent 630c9e1f9d
commit 8bfa520a01

View File

@ -54,7 +54,8 @@ Fields
Required. A hash of, and metadata about, the password. (Django doesn't Required. A hash of, and metadata about, the password. (Django doesn't
store the raw password.) Raw passwords can be arbitrarily long and can store the raw password.) Raw passwords can be arbitrarily long and can
contain any character. See the :doc:`password documentation contain any character. The metadata in this field may mark the password
as unusable. See the :doc:`password documentation
</topics/auth/passwords>`. </topics/auth/passwords>`.
.. attribute:: groups .. attribute:: groups
@ -179,8 +180,9 @@ Methods
.. method:: set_unusable_password() .. method:: set_unusable_password()
Marks the user as having no password set. This isn't the same as Marks the user as having no password set by updating the metadata in
having a blank string for a password. the :attr:`~django.contrib.auth.models.User.password` field. This isn't
the same as having a blank string for a password.
:meth:`~django.contrib.auth.models.User.check_password()` for this user :meth:`~django.contrib.auth.models.User.check_password()` for this user
will never return ``True``. Doesn't save the will never return ``True``. Doesn't save the
:class:`~django.contrib.auth.models.User` object. :class:`~django.contrib.auth.models.User` object.