1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-04 12:52:15 +02:00

Protect some pages

This commit is contained in:
Yohann D'ANELLO
2020-09-27 16:35:31 +02:00
parent 56193dbecf
commit 88c4a6b218
5 changed files with 136 additions and 65 deletions

View File

@ -59,6 +59,10 @@ class Registration(PolymorphicModel):
def participates(self):
return isinstance(self, StudentRegistration) or isinstance(self, CoachRegistration)
@property
def is_admin(self):
return isinstance(self, AdminRegistration) or self.user.is_superuser
def __str__(self):
return f"{self.user.first_name} {self.user.last_name}"