Allow root to reset user password

This commit is contained in:
Skia
2016-08-13 17:15:45 +02:00
parent a033c4dfd2
commit 792563999b
7 changed files with 265 additions and 195 deletions

View File

@ -223,6 +223,9 @@ class User(AbstractBaseUser):
return True
return self.groups.filter(name=group_name).exists()
def is_root(self):
return self.is_superuser or self.groups.filter(name=settings.SITH_GROUPS['root']['name']).exists()
def save(self, *args, **kwargs):
with transaction.atomic():
if self.id: