Skip to content
Snippets Groups Projects
Commit 2fcd6f6a authored by Antoine Pourthié's avatar Antoine Pourthié
Browse files

methode de notification des demissions

parent 4fb08c9a
No related branches found
No related tags found
No related merge requests found
......@@ -1192,6 +1192,26 @@ class FormSemestre(models.ScoDocModel):
"[ScoDoc] " + subject, email.get_from_addr(), destinations, txt
)
def _notify_demission(self, etud: Identite) -> None:
"Notifie la démission d'un étudiant: envoie un mail selon paramétrage"
destinations = (
sco_preferences.get_preference("emails_notifications_demissions", self.id)
or ""
)
destinations = [x.strip() for x in destinations.split(",")]
destinations = [x for x in destinations if x]
if not destinations:
return
txt = f"""{etud.nom_prenom()} a démissionné {etud.e} en {self.titre_annee()}"""
subject = f"""Démission de {etud.nom_prenom()} en {self.titre_annee()}"""
# build mail
log(f"_notify_demission: sending notification to {destinations}")
log(f"_notify_demission: subject: {subject}")
log(txt)
email.send_email(
"[ScoDoc] " + subject, email.get_from_addr(), destinations, txt
)
def get_partitions_list(
self, with_default=True, only_listed=False
) -> list[Partition]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment