superusers get their own cache key
This commit is contained in:
parent
0f251af6a9
commit
ae5bbb7705
1 changed files with 5 additions and 0 deletions
|
@ -67,6 +67,11 @@ class AccessPermission(models.Model):
|
|||
|
||||
@classmethod
|
||||
def cache_key_for_request(cls, request, with_update=True):
|
||||
if request.user.is_superuser:
|
||||
return (
|
||||
((MapUpdate.current_cache_key() + ':') if with_update else '') +
|
||||
'SU'
|
||||
)
|
||||
return (
|
||||
((MapUpdate.current_cache_key()+':') if with_update else '') +
|
||||
','.join(str(i) for i in sorted(AccessPermission.get_for_request(request)) or '0')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue