From 1a70eb65f1478202ea840adf18550904be593a62 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 26 Sep 2022 23:14:34 +0200 Subject: [PATCH] oups: rectificatif --- app/scodoc/sco_report_but.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_report_but.py b/app/scodoc/sco_report_but.py index dbf661dd..b920079f 100644 --- a/app/scodoc/sco_report_but.py +++ b/app/scodoc/sco_report_but.py @@ -135,11 +135,6 @@ def but_indicateurs_by_bac(formsemestre: FormSemestre) -> dict[str:dict]: res: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre) etuds = formsemestre.get_inscrits(include_demdef=True) - decisions_annee = { - etud.id: jury_but.DecisionsProposeesAnnee(etud, formsemestre) - for etud in etuds - if res.get_etud_etat(etud.id) == scu.INSCRIT - } # Ventilation par bac etuds_by_bac = defaultdict(list) # bac : etuds for etud in etuds: @@ -148,9 +143,20 @@ def but_indicateurs_by_bac(formsemestre: FormSemestre) -> dict[str:dict]: etuds_by_bac[bac].append(etud) indicateurs_by_bac = {} for bac in etuds_by_bac: + decisions_annee = { + etud.id: jury_but.DecisionsProposeesAnnee(etud, formsemestre) + for etud in etuds_by_bac[bac] + if res.get_etud_etat(etud.id) == scu.INSCRIT + } indicateurs_by_bac[bac] = _indicateurs_enquete_but( res, etuds_by_bac[bac], decisions_annee, next_sem_idx ) + # refait pour tous + decisions_annee = { + etud.id: jury_but.DecisionsProposeesAnnee(etud, formsemestre) + for etud in etuds + if res.get_etud_etat(etud.id) == scu.INSCRIT + } indicateurs_by_bac["Total"] = _indicateurs_enquete_but( res, etuds, decisions_annee, next_sem_idx )