From b7fb608142a0be568bc5dce952de5e6aefc2488c Mon Sep 17 00:00:00 2001 From: Olexander Yermakov Date: Wed, 31 Aug 2016 11:07:30 +0300 Subject: Fixed #27154 -- Allowed comparing CallableBool with bitwise or. Thanks Tim for the review. --- django/utils/deprecation.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'django/utils') diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py index 020f69b032..6fc27a8edd 100644 --- a/django/utils/deprecation.py +++ b/django/utils/deprecation.py @@ -116,6 +116,9 @@ class CallableBool: def __ne__(self, other): return self.value != other + def __or__(self, other): + return bool(self.value or other) + CallableFalse = CallableBool(False) CallableTrue = CallableBool(True) -- cgit v1.3