1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-08 20:50:19 +02:00

Create more mailing lists

This commit is contained in:
Yohann D'ANELLO
2020-11-14 22:18:35 +01:00
parent 02ca1d1efe
commit 10932d1cc5
3 changed files with 55 additions and 0 deletions

View File

@ -223,6 +223,11 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
mail_plain = render_to_string("participation/mails/team_validated.txt", mail_context)
mail_html = render_to_string("participation/mails/team_validated.html", mail_context)
send_mail("[Corres2math] Équipe validée", mail_plain, None, [self.object.email], html_message=mail_html)
get_sympa_client().subscribe(self.object.email, "equipes", False, f"Equipe {self.object.name}")
get_sympa_client().unsubscribe(self.object.email, "equipes-non-valides", False)
get_sympa_client().subscribe(self.object.email, f"probleme-{self.object.participation.problem}", False,
f"Equipe {self.object.name}")
elif "invalidate" in self.request.POST:
self.object.participation.valid = None
self.object.participation.save()