Skip to content

Commit

Permalink
Fixed #2418 -- Fixed obsolete method call in PermLookupDict.__repr__.…
Browse files Browse the repository at this point in the history
… Thanks,

DarkElf109@ibendit.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Sep 23, 2006
1 parent 26954aa commit 93597d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion django/core/context_processors.py
Expand Up @@ -51,15 +51,19 @@ def request(request):
class PermLookupDict(object):
def __init__(self, user, module_name):
self.user, self.module_name = user, module_name

def __repr__(self):
return str(self.user.get_permission_list())
return str(self.user.get_all_permissions())

def __getitem__(self, perm_name):
return self.user.has_perm("%s.%s" % (self.module_name, perm_name))

def __nonzero__(self):
return self.user.has_module_perms(self.module_name)

class PermWrapper(object):
def __init__(self, user):
self.user = user

def __getitem__(self, module_name):
return PermLookupDict(self.user, module_name)

0 comments on commit 93597d0

Please sign in to comment.