mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
Hided launderette slots and tokens for non authorized users and added is_office and is_launderette
This commit is contained in:
1 parent
f1e54439e1
commit
2d16b9c296
2 files changed
+19
-7
No files matched your search
@@ -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