1
0
forked from ScoDoc/ScoDoc

Merge branch 'master' of https://scodoc.org/git/ScoDoc/ScoDoc into api

This commit is contained in:
leonard_montalbano 2022-02-24 14:10:53 +01:00
commit 35be7ebb4c
2 changed files with 31 additions and 22 deletions

View File

@ -1013,11 +1013,16 @@ def mail_bulletin(formsemestre_id, I, pdfdata, filename, recipient_addr):
intro_mail = sco_preferences.get_preference("bul_intro_mail", formsemestre_id)
if intro_mail:
hea = intro_mail % {
"nomprenom": etud["nomprenom"],
"dept": dept,
"webmaster": webmaster,
}
try:
hea = intro_mail % {
"nomprenom": etud["nomprenom"],
"dept": dept,
"webmaster": webmaster,
}
except KeyError as e:
raise ScoValueError(
"format 'Message d'accompagnement' (bul_intro_mail) invalide, revoir les réglages dans les préférences"
)
else:
hea = ""

View File

@ -854,23 +854,27 @@ def formsemestre_import_etud_admission(
apo_emailperso = etud.get("mailperso", "")
if info["emailperso"] and not apo_emailperso:
apo_emailperso = info["emailperso"]
if (
import_email
and info["email"] != etud["mail"]
or info["emailperso"] != apo_emailperso
):
sco_etud.adresse_edit(
cnx,
args={
"etudid": etudid,
"adresse_id": info["adresse_id"],
"email": etud["mail"],
"emailperso": apo_emailperso,
},
)
# notifie seulement les changements d'adresse mail institutionnelle
if info["email"] != etud["mail"]:
changed_mails.append((info, etud["mail"]))
if import_email:
if not "mail" in etud:
raise ScoValueError(
"la réponse portail n'a pas le champs requis 'mail'"
)
if (
info["email"] != etud["mail"]
or info["emailperso"] != apo_emailperso
):
sco_etud.adresse_edit(
cnx,
args={
"etudid": etudid,
"adresse_id": info["adresse_id"],
"email": etud["mail"],
"emailperso": apo_emailperso,
},
)
# notifie seulement les changements d'adresse mail institutionnelle
if info["email"] != etud["mail"]:
changed_mails.append((info, etud["mail"]))
else:
unknowns.append(code_nip)
sco_cache.invalidate_formsemestre(formsemestre_id=sem["formsemestre_id"])