From 8d963db983321f9801b212efcf80478b0909c248 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 11 Feb 2022 16:34:02 +0100 Subject: [PATCH] Pas de rangs dans les modimpls --- app/comp/res_common.py | 4 +--- app/scodoc/sco_bulletins.py | 7 ++++++- app/scodoc/sco_poursuite_dut.py | 9 ++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/comp/res_common.py b/app/comp/res_common.py index 93971651..649970ad 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -311,9 +311,7 @@ class NotesTableCompat(ResultatsSemestre): self.bonus = None # virtuel self.bonus_ues = None # virtuel self.ue_rangs = {u.id: (None, nb_etuds) for u in self.ues} - self.mod_rangs = { - m.id: (None, nb_etuds) for m in self.formsemestre.modimpls_sorted - } + self.mod_rangs = None # sera surchargé en Classic, mais pas en APC self.moy_min = "NA" self.moy_max = "NA" self.moy_moy = "NA" diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py index beb224d0..4eb3a2d2 100644 --- a/app/scodoc/sco_bulletins.py +++ b/app/scodoc/sco_bulletins.py @@ -621,7 +621,12 @@ def _ue_mod_bulletin(etudid, formsemestre_id, ue_id, modimpls, nt, version): e["note_txt"] = e["note_html"] = "" e["coef_txt"] = scu.fmt_coef(e["coefficient"]) # Classement - if bul_show_mod_rangs and mod["mod_moy_txt"] != "-" and not is_malus: + if ( + bul_show_mod_rangs + and (nt.mod_rangs is not None) + and mod["mod_moy_txt"] != "-" + and not is_malus + ): rg = nt.mod_rangs[modimpl["moduleimpl_id"]] if rg[0] is None: mod["mod_rang_txt"] = "" diff --git a/app/scodoc/sco_poursuite_dut.py b/app/scodoc/sco_poursuite_dut.py index e7fe5685..60dfa2ab 100644 --- a/app/scodoc/sco_poursuite_dut.py +++ b/app/scodoc/sco_poursuite_dut.py @@ -86,9 +86,12 @@ def etud_get_poursuite_info(sem, etud): nt.get_etud_mod_moy(modimpl["moduleimpl_id"], etudid) ) if noteModule != "NI": # si étudiant inscrit au module - rangModule = nt.mod_rangs[modimpl["moduleimpl_id"]][0][ - etudid - ] + if nt.mod_rangs is not None: + rangModule = nt.mod_rangs[modimpl["moduleimpl_id"]][ + 0 + ][etudid] + else: + rangModule = "" modules.append([codeModule, noteModule]) rangs.append(["rang_" + codeModule, rangModule])