mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-04 18:46:52 +00:00
Ensure that teams have a participation
This commit is contained in:
parent
10932d1cc5
commit
48b34e4362
@ -65,7 +65,7 @@ class Team(models.Model):
|
||||
"education",
|
||||
raise_error=False,
|
||||
)
|
||||
if self.participation.valid:
|
||||
if self.pk and self.participation.valid:
|
||||
get_sympa_client().subscribe(self.email, "equipes", False, f"Equipe {self.name}")
|
||||
get_sympa_client().subscribe(self.email, f"probleme-{self.participation.problem}", False,
|
||||
f"Equipe {self.name}")
|
||||
|
@ -2,7 +2,7 @@ from corres2math.lists import get_sympa_client
|
||||
from participation.models import Participation, Team, Video
|
||||
|
||||
|
||||
def create_team_participation(instance, **_):
|
||||
def create_team_participation(instance, created, **_):
|
||||
"""
|
||||
When a team got created, create an associated team and create Video objects.
|
||||
"""
|
||||
@ -12,6 +12,8 @@ def create_team_participation(instance, **_):
|
||||
if not participation.synthesis:
|
||||
participation.synthesis = Video.objects.create()
|
||||
participation.save()
|
||||
if not created:
|
||||
participation.team.create_mailing_list()
|
||||
|
||||
|
||||
def update_mailing_list(instance: Team, **_):
|
||||
|
Loading…
Reference in New Issue
Block a user