summaryrefslogtreecommitdiff
path: root/django/contrib/auth/context_processors.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-08-08 14:52:21 +0200
committerClaude Paroz <claude@2xlibre.net>2012-08-08 15:02:31 +0200
commit576ec12f8e7024679202b6213b8664ccd8b451b7 (patch)
treed843909b73b11031a2eb105c35f1ad3a2c3fab53 /django/contrib/auth/context_processors.py
parent12cda89ffe6a03031a321d61ff8b91f9978e4b2e (diff)
[py3] Replaced __nonzero__ by __bool__
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
Diffstat (limited to 'django/contrib/auth/context_processors.py')
-rw-r--r--django/contrib/auth/context_processors.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/auth/context_processors.py b/django/contrib/auth/context_processors.py
index 3ffab01e94..1b6c2eedd0 100644
--- a/django/contrib/auth/context_processors.py
+++ b/django/contrib/auth/context_processors.py
@@ -11,8 +11,9 @@ class PermLookupDict(object):
def __getitem__(self, perm_name):
return self.user.has_perm("%s.%s" % (self.module_name, perm_name))
- def __nonzero__(self):
+ def __bool__(self):
return self.user.has_module_perms(self.module_name)
+ __nonzero__ = __bool__ # Python 2
class PermWrapper(object):