summaryrefslogtreecommitdiff
path: root/django/utils/deprecation.py
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:01:08 -0400
commit54afa960d1ee8c63635225a0f0a2489971b5aab5 (patch)
tree89cdc33c2ffd2bb7ce034004fc8bb2d9a3a67c51 /django/utils/deprecation.py
parentd95c669c29a0403cd1098664f0ef863fae8b7c98 (diff)
Fixed #26988 -- Improved/clarified User.is_authenticated/anonymous compatibility.
Thanks marktranchant for the report and review.
Diffstat (limited to 'django/utils/deprecation.py')
-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 5bff40f474..020f69b032 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -110,6 +110,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)