userpermissions for unauthenticated users
This commit is contained in:
parent
048f7facec
commit
444e45b110
1 changed files with 2 additions and 0 deletions
|
@ -32,6 +32,8 @@ class UserPermissions(models.Model):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_for_user(cls, user, force=False) -> 'UserPermissions':
|
def get_for_user(cls, user, force=False) -> 'UserPermissions':
|
||||||
|
if not user.is_authenticated:
|
||||||
|
return cls()
|
||||||
cache_key = cls.get_cache_key(user.pk)
|
cache_key = cls.get_cache_key(user.pk)
|
||||||
result = None
|
result = None
|
||||||
if not force:
|
if not force:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue