summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-12-31 11:46:40 -0500
committerTim Graham <timograham@gmail.com>2017-01-17 20:52:03 -0500
commiteba093e8b02989af1857b1915907ca0897f565ff (patch)
tree9168860253e3956ced80b9e639e8e1c36211057c /django/utils
parentb70094f0408384993e149ffcfc86cc2d405308d1 (diff)
Refs #25847 -- Removed support for User.is_(anonymous|authenticated) as methods.
Per deprecation timeline.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/deprecation.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 2963e60214..b862a161b2 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -84,49 +84,6 @@ class DeprecationInstanceCheck(type):
return super(DeprecationInstanceCheck, self).__instancecheck__(instance)
-class CallableBool:
- """
- An boolean-like object that is also callable for backwards compatibility.
- """
- do_not_call_in_templates = True
-
- def __init__(self, value):
- self.value = value
-
- def __bool__(self):
- return self.value
-
- def __call__(self):
- warnings.warn(
- "Using user.is_authenticated() and user.is_anonymous() as a method "
- "is deprecated. Remove the parentheses to use it as an attribute.",
- RemovedInDjango20Warning, stacklevel=2
- )
- return self.value
-
- def __nonzero__(self): # Python 2 compatibility
- return self.value
-
- def __repr__(self):
- return 'CallableBool(%r)' % self.value
-
- def __eq__(self, other):
- return self.value == other
-
- def __ne__(self, other):
- return self.value != other
-
- def __or__(self, other):
- return bool(self.value or other)
-
- def __hash__(self):
- return hash(self.value)
-
-
-CallableFalse = CallableBool(False)
-CallableTrue = CallableBool(True)
-
-
class MiddlewareMixin(object):
def __init__(self, get_response=None):
self.get_response = get_response