1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 06:42:48 +02:00

Protect pages (not tested)

This commit is contained in:
Yohann D'ANELLO
2021-01-17 12:40:23 +01:00
parent 1e413229a1
commit c151ff3611
7 changed files with 207 additions and 37 deletions

View File

@ -81,6 +81,10 @@ class Registration(PolymorphicModel):
def is_admin(self):
return isinstance(self, AdminRegistration) or self.user.is_superuser
@property
def is_volunteer(self):
return isinstance(self, VolunteerRegistration)
@property
def matrix_username(self):
return f"tfjm_{self.user.pk}"
@ -249,6 +253,10 @@ class VolunteerRegistration(Registration):
verbose_name=_("professional activity"),
)
@property
def interesting_tournaments(self) -> set:
return set(self.organized_tournaments.all()).union(map(lambda pool: pool.tournament, self.jury_in.all()))
@property
def type(self):
return _('volunteer')