From 4c5c20ce7e4ef3d86c704c1e8225d3146eaccb29 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 26 Jan 2022 00:11:04 +0100 Subject: [PATCH] comptes absences dans bul json BUT --- app/but/bulletin_but.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 1c45d6e0e..79d3b776f 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -16,6 +16,7 @@ from app.comp import moy_ue, moy_sem, inscr_mod from app.models import ModuleImpl from app.scodoc import sco_utils as scu from app.scodoc.sco_cache import ResultatsSemestreBUTCache +from app.scodoc import sco_abs from app.scodoc import sco_bulletins_json from app.scodoc import sco_preferences from app.scodoc.sco_utils import jsnan, fmt_note @@ -244,6 +245,8 @@ class ResultatsSemestreBUT: } if not published: return d + + nbabs, nbabsjust = formsemestre.get_abs_count(etud.id) semestre_infos = { "etapes": [str(x.etape_apo) for x in formsemestre.etapes if x.etape_apo], "date_debut": formsemestre.date_debut.isoformat(), @@ -252,9 +255,9 @@ class ResultatsSemestreBUT: "inscription": "TODO-MM-JJ", # XXX TODO "numero": formsemestre.semestre_id, "groupes": [], # XXX TODO - "absences": { # XXX TODO - "injustifie": 1, - "total": 33, + "absences": { + "injustifie": nbabsjust, + "total": nbabs, }, } semestre_infos.update(