summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTobias Schulmann <tobias.schulmann@outlook.com>2017-07-23 08:43:23 +1200
committerTim Graham <timograham@gmail.com>2017-07-24 13:41:16 -0400
commitaef117eb2e7805c5965adbfbfe1b5374cb58bbbe (patch)
tree0b6d72da5d0448c56ef395e360a2b237ddcd2cd1 /docs/ref
parent801b6fb32e36a9b61ae469e29e17650dd8afd9fe (diff)
[1.11.x] Fixed #28420 -- Doc'd 'is' comparison restriction for User.is_authenticated/anonymous.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/auth.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt
index b50bc966e5..71c6bd2ce1 100644
--- a/docs/ref/contrib/auth.txt
+++ b/docs/ref/contrib/auth.txt
@@ -145,6 +145,15 @@ Attributes
In older versions, this was a method. Backwards-compatibility
support for using it as a method will be removed in Django 2.0.
+ .. admonition:: Don't use the ``is`` operator for comparisons!
+
+ To allow the ``is_authenticated`` and ``is_anonymous`` attributes
+ to also work as methods, the attributes are ``CallableBool``
+ objects. Thus, until the deprecation period ends in Django 2.0, you
+ can't compare these properties using the ``is`` operator. That is,
+ ``request.user.is_authenticated is True`` always evaluate to
+ ``False``.
+
.. attribute:: is_anonymous
Read-only attribute which is always ``False``. This is a way of