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:
@ -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')
|
||||
|
Reference in New Issue
Block a user