1
0
mirror of https://github.com/django/django.git synced 2025-03-28 10:10:45 +00:00

[5.1.x] Fixed #35670 -- Clarified the return value for LoginRequiredMiddleware's methods.

Backport of efc3b0c627f7e3cb4e337280ecd2483758dcb0a5 from main.
This commit is contained in:
Aditya Chaudhary 2024-10-02 21:45:21 +05:30 committed by Natalia
parent 53031136f5
commit bf64ac3567

View File

@ -560,19 +560,19 @@ unauthenticated requests.
.. method:: get_login_url() .. method:: get_login_url()
Returns the URL that unauthenticated requests will be redirected to. If Returns the URL that unauthenticated requests will be redirected to. This
defined, this returns the ``login_url`` set on the result is either the ``login_url`` set on the
:func:`~.django.contrib.auth.decorators.login_required` decorator. Defaults :func:`~django.contrib.auth.decorators.login_required` decorator (if not
to :setting:`settings.LOGIN_URL <LOGIN_URL>`. ``None``), or :setting:`settings.LOGIN_URL <LOGIN_URL>`.
.. method:: get_redirect_field_name() .. method:: get_redirect_field_name()
Returns the name of the query parameter that contains the URL the user Returns the name of the query parameter that contains the URL the user
should be redirected to after a successful login. If defined, this returns should be redirected to after a successful login. This result is either
the ``redirect_field_name`` set on the the ``redirect_field_name`` set on the
:func:`~.django.contrib.auth.decorators.login_required` decorator. Defaults :func:`~.django.contrib.auth.decorators.login_required` decorator (if not
to :attr:`redirect_field_name`. If ``None`` is returned, a query parameter ``None``), or :attr:`redirect_field_name`. If ``None`` is returned, a query
won't be added. parameter won't be added.
.. class:: RemoteUserMiddleware .. class:: RemoteUserMiddleware