From 975b4247e07f2ea38a50dfc85214ddd9e0a5dfc4 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Aug 2023 19:08:01 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20calcul=20de=20la=20liste=20des=20niveaux?= =?UTF-8?q?=20associ=C3=A9s=20=C3=A0=20une=20ann=C3=A9e=20de=20parcours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/but_refcomp.py | 13 ++++++++++--- sco_version.py | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/models/but_refcomp.py b/app/models/but_refcomp.py index 2cb1145d..73ddf9f7 100644 --- a/app/models/but_refcomp.py +++ b/app/models/but_refcomp.py @@ -471,9 +471,16 @@ class ApcNiveau(db.Model, XMLModel): for pn in parcour_niveaux ] else: - niveaux: list[ApcNiveau] = competence.niveaux.filter_by( - annee=f"BUT{int(annee)}" - ).all() + niveaux: list[ApcNiveau] = ( + ApcNiveau.query.filter_by(annee=f"BUT{int(annee)}") + .join(ApcCompetence) + .filter_by(id=competence.id) + .join(ApcParcoursNiveauCompetence) + .filter(ApcParcoursNiveauCompetence.niveau == ApcNiveau.ordre) + .join(ApcAnneeParcours) + .filter_by(parcours_id=parcour.id) + .all() + ) _cache[key] = niveaux return niveaux diff --git a/sco_version.py b/sco_version.py index c7e07631..697be935 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.6" +SCOVERSION = "9.6.7" SCONAME = "ScoDoc"