forked from ScoDoc/DocScoDoc
Fix: synchro Apogée quand étudiants ajoutés manuellement
This commit is contained in:
parent
14d533b38a
commit
ddf4bf788f
@ -279,6 +279,7 @@ def ficheEtud(etudid=None, REQUEST=None):
|
||||
l.append("</b></b>")
|
||||
info["liste_inscriptions"] = "\n".join(l)
|
||||
info["link_bul_pdf"] = ""
|
||||
info["link_inscrire_ailleurs"] = ""
|
||||
|
||||
# Liste des annotations
|
||||
alist = []
|
||||
|
@ -126,9 +126,13 @@ def formsemestre_synchro_etuds(
|
||||
etuds = etuds.split(",") # vient du form de confirmation
|
||||
elif isinstance(etuds, int):
|
||||
etuds = [etuds]
|
||||
if isinstance(inscrits_without_key, str):
|
||||
if isinstance(inscrits_without_key, int):
|
||||
inscrits_without_key = [inscrits_without_key]
|
||||
elif isinstance(inscrits_without_key, str):
|
||||
inscrits_without_key = inscrits_without_key.split(",")
|
||||
|
||||
elif not isinstance(inscrits_without_key, list):
|
||||
raise ValueError("invalid type for inscrits_without_key")
|
||||
inscrits_without_key = [int(x) for x in inscrits_without_key]
|
||||
(
|
||||
etuds_by_cat,
|
||||
a_importer,
|
||||
@ -200,31 +204,38 @@ def formsemestre_synchro_etuds(
|
||||
)
|
||||
H.append("</ol>")
|
||||
|
||||
if a_desinscrire or a_desinscrire_without_key:
|
||||
if a_desinscrire:
|
||||
H.append("<h3>Etudiants à désinscrire :</h3><ol>")
|
||||
for key in a_desinscrire:
|
||||
etud = sco_etud.get_etud_info(filled=True, code_nip=key)[0]
|
||||
H.append('<li class="desinscription">%(nomprenom)s</li>' % etud)
|
||||
H.append("</ol>")
|
||||
if a_desinscrire_without_key:
|
||||
H.append("<h3>Etudiants à désinscrire (sans code):</h3><ol>")
|
||||
for etudid in a_desinscrire_without_key:
|
||||
etud = inscrits_without_key_all[etudid]
|
||||
sco_etud.format_etud_ident(etud)
|
||||
H.append('<li class="desinscription">%(nomprenom)s</li>' % etud)
|
||||
H.append("</ol>")
|
||||
|
||||
if not a_importer and not a_inscrire and not a_desinscrire:
|
||||
todo = (
|
||||
a_importer or a_inscrire or a_desinscrire or a_desinscrire_without_key
|
||||
)
|
||||
if not todo:
|
||||
H.append("""<h3>Il n'y a rien à modifier !</h3>""")
|
||||
|
||||
H.append(
|
||||
scu.confirm_dialog(
|
||||
dest_url="formsemestre_synchro_etuds",
|
||||
add_headers=False,
|
||||
cancel_url="formsemestre_synchro_etuds?formsemestre_id="
|
||||
+ str(formsemestre_id),
|
||||
OK="Effectuer l'opération",
|
||||
OK="Effectuer l'opération" if todo else "OK",
|
||||
parameters={
|
||||
"formsemestre_id": formsemestre_id,
|
||||
"etuds": ",".join(etuds),
|
||||
"inscrits_without_key": ",".join(inscrits_without_key),
|
||||
"inscrits_without_key": ",".join(
|
||||
[str(x) for x in inscrits_without_key]
|
||||
),
|
||||
"submitted": 1,
|
||||
"anneeapogee": anneeapogee,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user