From 5f06b190a2b0c4a70c331789ea74fb47c4f1e8ed Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 2 Jul 2023 17:03:06 +0200 Subject: [PATCH] =?UTF-8?q?Export=20Apog=C3=A9e:=20ADSUPS=20RCUEs=20+=20fi?= =?UTF-8?q?x=20export=20moy.=20UE=20quand=20pas=20de=20d=C3=A9cision=20de?= =?UTF-8?q?=20jury?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_apogee_csv.py | 39 +++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_apogee_csv.py b/app/scodoc/sco_apogee_csv.py index e58e0500..61af26bd 100644 --- a/app/scodoc/sco_apogee_csv.py +++ b/app/scodoc/sco_apogee_csv.py @@ -336,14 +336,22 @@ class ApoEtud(dict): x.strip() for x in ue["code_apogee"].split(",") }: 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"]) - 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( N=self.fmt_note(ue_status["moy"] if ue_status else ""), B=20, J="", - R=ScoDocSiteConfig.get_code_apo(code_decision_ue), + R=code_decision_ue_apo, M="", ) else: @@ -927,8 +935,28 @@ class ApoData: } 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( - columns_ids=("code_nip", "nom", "prenom", "formsemestre", "etape", "ue"), + columns_ids=( + "code_nip", + "nom", + "prenom", + "formsemestre", + "etape", + "ue", + "rcue", + ), titles={ "code_nip": "NIP", "nom": "Nom", @@ -936,8 +964,9 @@ class ApoData: "formsemestre": "Semestre", "etape": "Etape", "ue": "UE", + "rcue": "RCUE", }, - row=rows, + rows=rows, xls_sheet_name="ADSUPs", )