mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 12:29:24 +00:00
Hided launderette slots and tokens for non authorized users and added is_office and is_launderette
This commit is contained in:
@ -231,6 +231,16 @@ class User(AbstractBaseUser):
|
||||
def is_root(self):
|
||||
return self.is_superuser or self.groups.filter(name=settings.SITH_GROUPS['root']['name']).exists()
|
||||
|
||||
@property
|
||||
def is_office(self):
|
||||
from club.models import Club
|
||||
return Club.objects.filter(unix_name='laverie').first().get_membership_for(self)
|
||||
|
||||
@property
|
||||
def is_launderette(self):
|
||||
from club.models import Club
|
||||
return Club.objects.filter(unix_name='').first().get_membership_for(self)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
create = False
|
||||
with transaction.atomic():
|
||||
|
Reference in New Issue
Block a user