Commit 82df4241 authored by Skia's avatar Skia

core: put's names in cache

parent af3e2fb9
......@@ -366,7 +366,11 @@ class User(AbstractBaseUser):
return False
if group_id == settings.SITH_GROUP_ROOT_ID and self.is_superuser:
return True
return self.groups.filter(name=group_name).exists()
return group_name in self.cached_groups_names
def cached_groups_names(self):
return [ for g in self.groups.all()]
def is_root(self):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment