Skip to content

Commit

Permalink
Modified cach_helper.py to treat cached empty perm lists as a cache hit
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenRiedlinger committed Sep 20, 2012
1 parent 1c3c6f6 commit cc4a395
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rulez/rolez/cache_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def get_roles(user, obj):
"""
# get roles for the user, if present:
roles = cache.get(roles_key(user, obj))
if roles:
# Cache hit
if isinstance(roles, list):
# Cache hit (a miss returns NoneType rather than an empty list)
return roles
else:
# we need to recompute roles for this model
Expand Down

0 comments on commit cc4a395

Please sign in to comment.