Export Apogée: ADSUPS RCUEs + fix export moy. UE quand pas de décision de jury

This commit is contained in:
Emmanuel Viennet 2023-07-02 17:03:06 +02:00
parent 937a96d086
commit 5f06b190a2

View File

@ -336,14 +336,22 @@ class ApoEtud(dict):
x.strip() for x in ue["code_apogee"].split(",") x.strip() for x in ue["code_apogee"].split(",")
}: }:
if self.export_res_ues: if self.export_res_ues:
if decisions_ue and ue["ue_id"] in decisions_ue: if (
decisions_ue and ue["ue_id"] in decisions_ue
) or self.export_res_sdj:
ue_status = res.get_etud_ue_status(etudid, ue["ue_id"]) ue_status = res.get_etud_ue_status(etudid, ue["ue_id"])
code_decision_ue = decisions_ue[ue["ue_id"]]["code"] if decisions_ue and ue["ue_id"] in decisions_ue:
code_decision_ue = decisions_ue[ue["ue_id"]]["code"]
code_decision_ue_apo = ScoDocSiteConfig.get_code_apo(
code_decision_ue
)
else:
code_decision_ue_apo = ""
return dict( return dict(
N=self.fmt_note(ue_status["moy"] if ue_status else ""), N=self.fmt_note(ue_status["moy"] if ue_status else ""),
B=20, B=20,
J="", J="",
R=ScoDocSiteConfig.get_code_apo(code_decision_ue), R=code_decision_ue_apo,
M="", M="",
) )
else: else:
@ -927,8 +935,28 @@ class ApoData:
} }
for v in validations_ues for v in validations_ues
] ]
rows += [
{
"code_nip": v.etud.code_nip,
"nom": v.etud.nom,
"prenom": v.etud.prenom,
"formsemestre": v.formsemestre.titre_formation(with_sem_idx=1),
"etape": "", # on ne sait pas à quel étape rattacher le RCUE
"rcue": f"{v.ue1.acronyme}/{v.ue2.acronyme}",
}
for v in validations_rcue
]
return GenTable( return GenTable(
columns_ids=("code_nip", "nom", "prenom", "formsemestre", "etape", "ue"), columns_ids=(
"code_nip",
"nom",
"prenom",
"formsemestre",
"etape",
"ue",
"rcue",
),
titles={ titles={
"code_nip": "NIP", "code_nip": "NIP",
"nom": "Nom", "nom": "Nom",
@ -936,8 +964,9 @@ class ApoData:
"formsemestre": "Semestre", "formsemestre": "Semestre",
"etape": "Etape", "etape": "Etape",
"ue": "UE", "ue": "UE",
"rcue": "RCUE",
}, },
row=rows, rows=rows,
xls_sheet_name="ADSUPs", xls_sheet_name="ADSUPs",
) )