1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 19:22:51 +02:00

Teams must send their motivation letter

This commit is contained in:
Yohann D'ANELLO
2021-01-22 09:40:28 +01:00
parent 628f69e772
commit ce206998f0
12 changed files with 402 additions and 224 deletions

View File

@ -20,6 +20,10 @@ from tfjm.lists import get_sympa_client
from tfjm.matrix import Matrix, RoomPreset, RoomVisibility
def get_motivation_letter_filename(instance, filename):
return f"authorization/motivation_letters/motivation_letter_{instance.trigram}"
class Team(models.Model):
"""
The Team model represents a real team that participates to the TFJM².
@ -45,6 +49,13 @@ class Team(models.Model):
help_text=_("The access code let other people to join the team."),
)
motivation_letter = models.FileField(
verbose_name=_("motivation letter"),
upload_to=get_motivation_letter_filename,
blank=True,
default="",
)
@property
def students(self):
return self.participants.filter(studentregistration__isnull=False)