浏览代码

Fixed #35670 -- Clarified the return value for LoginRequiredMiddleware's methods.

Aditya Chaudhary 5 月之前
父节点
当前提交
efc3b0c627
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      docs/ref/middleware.txt

+ 8 - 8
docs/ref/middleware.txt

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