Skip to content
Snippets Groups Projects
Commit 5a30d92c authored by Axel Saint-maxin's avatar Axel Saint-maxin
Browse files

send mail to notify operations

parent 69a39543
No related branches found
No related tags found
No related merge requests found
......@@ -630,7 +630,7 @@ class User(UserMixin, ScoDocModel):
def get_nomcomplet(self):
"Prénom et nom complets"
return "Tata Yoyoyoyo"
return scu.format_prenom(self.prenom) + " " + self.get_nom_fmt()
# nomnoacc était le nom en minuscules sans accents (inutile)
......
......@@ -57,6 +57,8 @@ from app.scodoc import sco_moduleimpl
from app.scodoc import sco_groups
from app.scodoc import sco_etud
from app.scodoc import sco_cache
from app.scodoc import sco_preferences
from app import email
# --- Gestion des inscriptions aux semestres
......@@ -142,10 +144,28 @@ def do_formsemestre_demission(
db.session.commit()
sco_cache.invalidate_formsemestre(formsemestre_id=formsemestre_id)
if etat_new == scu.DEMISSION:
flash("Démission enregistrée")
etud = Identite.get_etud(etudid)
prefs = sco_preferences.SemPreferences(
formsemestre_id=formsemestre.id if formsemestre else None
)
destination = prefs["emails_notifications"] or ""
if (destination == ""):
str_mail_send = "aucune adresse mail disponible pour notifier les opérations dans le paramétrage"
else :
send_demission_mail(etud.__repr__(),destination)
str_mail_send = "mail pour notifier les opérations envoyer"
flash("Démission enregistrée, " + str_mail_send)
elif etat_new == scu.DEF:
flash("Défaillance enregistrée")
def send_demission_mail(etud_info,destinations):
subject = "[ScoDoc] Notification de démission"
sender = email.get_from_addr()
txt = "La démission de l'étudiant : " + etud_info + " à était réaliser avec succès"
email.send_email(subject, sender, destinations, txt)
def do_formsemestre_inscription_edit(args=None, formsemestre_id=None):
"edit a formsemestre_inscription"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment