diff options
| author | Tim Graham <timograham@gmail.com> | 2016-08-02 09:32:00 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-02 11:01:08 -0400 |
| commit | 54afa960d1ee8c63635225a0f0a2489971b5aab5 (patch) | |
| tree | 89cdc33c2ffd2bb7ce034004fc8bb2d9a3a67c51 /django/utils/deprecation.py | |
| parent | d95c669c29a0403cd1098664f0ef863fae8b7c98 (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.py | 6 |
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) |
