mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-11-09 05:03:16 +01:00
Add distinction between scientific coach and accompanying coach
This commit is contained in:
@@ -70,13 +70,21 @@ class Team(models.Model):
|
||||
@property
|
||||
def coaches(self):
|
||||
return self.participants.filter(coachregistration__isnull=False)
|
||||
|
||||
@property
|
||||
def scientific_coaches(self):
|
||||
return self.participants.filter(coachregistration__isnull=False, coachregistration__is_scientific_coach=True)
|
||||
|
||||
@property
|
||||
def accompanying_coaches(self):
|
||||
return self.participants.filter(coachregistration__isnull=False, coachregistration__is_accompanying_coach=True)
|
||||
|
||||
def can_validate(self):
|
||||
if any(not r.email_confirmed for r in self.participants.all()):
|
||||
return False
|
||||
if self.students.count() < 4:
|
||||
return False
|
||||
if not self.coaches.exists():
|
||||
if not self.scientific_coaches.exists():
|
||||
return False
|
||||
if not self.participation.tournament:
|
||||
return False
|
||||
@@ -211,6 +219,7 @@ class Team(models.Model):
|
||||
:return: The mailing list to contact the team members.
|
||||
"""
|
||||
return f"equipe-{slugify(self.trigram)}@{settings.SYMPA_HOST}"
|
||||
|
||||
|
||||
def create_mailing_list(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user