From 79e2c9476ba96709892abec42ed718654ee7d484 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 15 Dec 2021 08:12:47 +0100 Subject: [PATCH] =?UTF-8?q?WIP:=20fix=20rapide=20pour=20eviter=20plante=20?= =?UTF-8?q?quand=20d=C3=A9missionnaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/comp/inscr_mod.py | 2 +- app/scodoc/notes_table.py | 13 +++++++------ sco_version.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/comp/inscr_mod.py b/app/comp/inscr_mod.py index 43f6eb0a2..4d9a573bb 100644 --- a/app/comp/inscr_mod.py +++ b/app/comp/inscr_mod.py @@ -22,7 +22,7 @@ def df_load_modimpl_inscr(formsemestre) -> pd.DataFrame: """ # méthode la moins lente: une requete par module, merge les dataframes moduleimpl_ids = [m.id for m in formsemestre.modimpls] - etudids = [i.etudid for i in formsemestre.inscriptions] + etudids = [i.etudid for i in formsemestre.get_inscrits()] df = pd.DataFrame(index=etudids, dtype=int) for moduleimpl_id in moduleimpl_ids: ins_df = pd.read_sql_query( diff --git a/app/scodoc/notes_table.py b/app/scodoc/notes_table.py index 7a6cfd050..052b387e1 100644 --- a/app/scodoc/notes_table.py +++ b/app/scodoc/notes_table.py @@ -980,8 +980,8 @@ class NotesTable: def get_table_moyennes_triees(self): return self.T - def get_etud_rang(self, etudid): - return self.rangs[etudid] + def get_etud_rang(self, etudid) -> str: + return self.rangs.get(etudid, "999") def get_etud_rang_group(self, etudid, group_id): """Returns rank of etud in this group and number of etuds in group. @@ -1350,10 +1350,11 @@ class NotesTable: ues = self.get_ues() # incluant le(s) UE de sport for t in self.T: etudid = t[-1] - t[0] = results.etud_moy_gen[etudid] - for i, ue in enumerate(ues, start=1): - if ue["type"] != UE_SPORT: - t[i] = results.etud_moy_ue[ue["id"]][etudid] + if etudid in results.etud_moy_gen: # evite les démissionnaires + t[0] = results.etud_moy_gen[etudid] + for i, ue in enumerate(ues, start=1): + if ue["type"] != UE_SPORT: + t[i] = results.etud_moy_ue[ue["id"]][etudid] # re-trie selon la nouvelle moyenne générale: self.T.sort(key=self._row_key) # Remplace aussi le rang: diff --git a/sco_version.py b/sco_version.py index 819dc0c73..6e341a849 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.5" +SCOVERSION = "9.1.6" SCONAME = "ScoDoc"