From 3844ae46d1853401eb54e6c3d092af344ad0960d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 20 Feb 2024 21:55:32 +0100 Subject: [PATCH] Fix (imports, tests). API unit tests breaks on BUT config (bul. court). --- app/but/cursus_but.py | 2 ++ app/scodoc/sco_edit_apc.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/but/cursus_but.py b/app/but/cursus_but.py index 4a16bf05..e2c45c9f 100644 --- a/app/but/cursus_but.py +++ b/app/but/cursus_but.py @@ -512,6 +512,8 @@ def formation_semestre_niveaux_warning(formation: Formation, semestre_idx: int) """ annee = (semestre_idx - 1) // 2 + 1 # année BUT ref_comp: ApcReferentielCompetences = formation.referentiel_competence + if not ref_comp: + return "" # détecté ailleurs... niveaux_sans_ue_by_parcour = {} # { parcour.code : [ ue ... ] } parcours_ids = { uep.parcours_id diff --git a/app/scodoc/sco_edit_apc.py b/app/scodoc/sco_edit_apc.py index b56a9393..805fa1fb 100644 --- a/app/scodoc/sco_edit_apc.py +++ b/app/scodoc/sco_edit_apc.py @@ -28,7 +28,6 @@ from flask.templating import render_template from app import db -from app.but import cursus_but from app.models import UniteEns, Matiere, Module, FormSemestre, ModuleImpl from app.models.validations import ScolarFormSemestreValidation from app.scodoc import codes_cursus @@ -48,6 +47,8 @@ def html_edit_formation_apc( - Les ressources - Les SAÉs """ + from app.but import cursus_but + cursus = formation.get_cursus() assert cursus.APC_SAE