summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-08-02 09:32:00 -0400
committerTim Graham <timograham@gmail.com>2016-08-02 11:26:40 -0400
commitfa4b5c1b9360dc4c6abe913e86d3d36793d8826a (patch)
tree12c491982724afc3d6c4f81e2e7171c847419070 /django/utils
parent11c5c3b8012328dfc0fbb78c758335c6e6054cc5 (diff)
[1.10.x] Fixed #26988 -- Improved/clarified User.is_authenticated/anonymous compatibility.
Thanks marktranchant for the report and review. Backport of 54afa960d1ee8c63635225a0f0a2489971b5aab5 from master
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/deprecation.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 351bd1d27d..0a0dd216da 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -107,6 +107,12 @@ class CallableBool:
def __repr__(self):
return 'CallableBool(%r)' % self.value
+ def __eq__(self, other):
+ return self.value == other
+
+ def __ne__(self, other):
+ return self.value != other
+
CallableFalse = CallableBool(False)
CallableTrue = CallableBool(True)