summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTobias Bengfort <tobias.bengfort@posteo.de>2018-11-03 16:07:44 +0100
committerTim Graham <timograham@gmail.com>2018-11-03 11:07:44 -0400
commit9a63d840ffaac291afd443eec89ac9c9d04b49dd (patch)
treee2d210b4c31d8b80527ac20378b3a659af5fd9ae /docs
parentd207ac1568bb4dee305f6692ed7ddee8a1ff8b99 (diff)
Fixed inconsistent indentation in docs/ref/contrib/auth.txt.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/auth.txt59
1 files changed, 30 insertions, 29 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt
index 62516a94d2..2f45dec574 100644
--- a/docs/ref/contrib/auth.txt
+++ b/docs/ref/contrib/auth.txt
@@ -549,7 +549,7 @@ The following backends are available in :mod:`django.contrib.auth.backends`:
Returns whether the ``user_obj`` has any permissions on the app
``app_label``.
- .. method:: ModelBackend.user_can_authenticate()
+ .. method:: user_can_authenticate()
Returns whether the user is allowed to authenticate. To match the
behavior of :class:`~django.contrib.auth.forms.AuthenticationForm`
@@ -582,45 +582,46 @@ The following backends are available in :mod:`django.contrib.auth.backends`:
If you need more control, you can create your own authentication backend
that inherits from this class and override these attributes or methods:
-.. attribute:: RemoteUserBackend.create_unknown_user
+ .. attribute:: create_unknown_user
- ``True`` or ``False``. Determines whether or not a user object is created
- if not already in the database Defaults to ``True``.
+ ``True`` or ``False``. Determines whether or not a user object is
+ created if not already in the database Defaults to ``True``.
-.. method:: RemoteUserBackend.authenticate(request, remote_user)
+ .. method:: authenticate(request, remote_user)
- The username passed as ``remote_user`` is considered trusted. This method
- simply returns the user object with the given username, creating a new
- user object if :attr:`~RemoteUserBackend.create_unknown_user` is ``True``.
+ The username passed as ``remote_user`` is considered trusted. This
+ method simply returns the user object with the given username, creating
+ a new user object if :attr:`~RemoteUserBackend.create_unknown_user` is
+ ``True``.
- Returns ``None`` if :attr:`~RemoteUserBackend.create_unknown_user` is
- ``False`` and a ``User`` object with the given username is not found in the
- database.
+ Returns ``None`` if :attr:`~RemoteUserBackend.create_unknown_user` is
+ ``False`` and a ``User`` object with the given username is not found in
+ the database.
- ``request`` is an :class:`~django.http.HttpRequest` and may be ``None`` if
- it wasn't provided to :func:`~django.contrib.auth.authenticate` (which
- passes it on to the backend).
+ ``request`` is an :class:`~django.http.HttpRequest` and may be ``None``
+ if it wasn't provided to :func:`~django.contrib.auth.authenticate`
+ (which passes it on to the backend).
-.. method:: RemoteUserBackend.clean_username(username)
+ .. method:: clean_username(username)
- Performs any cleaning on the ``username`` (e.g. stripping LDAP DN
- information) prior to using it to get or create a user object. Returns the
- cleaned username.
+ Performs any cleaning on the ``username`` (e.g. stripping LDAP DN
+ information) prior to using it to get or create a user object. Returns
+ the cleaned username.
-.. method:: RemoteUserBackend.configure_user(user)
+ .. method:: configure_user(user)
- Configures a newly created user. This method is called immediately after a
- new user is created, and can be used to perform custom setup actions, such
- as setting the user's groups based on attributes in an LDAP directory.
- Returns the user object.
+ Configures a newly created user. This method is called immediately
+ after a new user is created, and can be used to perform custom setup
+ actions, such as setting the user's groups based on attributes in an
+ LDAP directory. Returns the user object.
-.. method:: RemoteUserBackend.user_can_authenticate()
+ .. method:: user_can_authenticate()
- Returns whether the user is allowed to authenticate. This method returns
- ``False`` for users with :attr:`is_active=False
- <django.contrib.auth.models.User.is_active>`. Custom user models that don't
- have an :attr:`~django.contrib.auth.models.CustomUser.is_active` field are
- allowed.
+ Returns whether the user is allowed to authenticate. This method
+ returns ``False`` for users with :attr:`is_active=False
+ <django.contrib.auth.models.User.is_active>`. Custom user models that
+ don't have an :attr:`~django.contrib.auth.models.CustomUser.is_active`
+ field are allowed.
.. class:: AllowAllUsersRemoteUserBackend