From 1676fba5ab53d8ac6b4f8dd26d36f1e3031539e0 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 8 Jun 2022 17:56:27 +0200 Subject: [PATCH] moduleimpl_is_conforme: bug cache (?) => refresh et exception --- app/comp/moy_mod.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/comp/moy_mod.py b/app/comp/moy_mod.py index f5efbeb25..8f8bd1a89 100644 --- a/app/comp/moy_mod.py +++ b/app/comp/moy_mod.py @@ -41,7 +41,8 @@ from app import db from app.models import ModuleImpl, Evaluation, EvaluationUEPoids from app.scodoc import sco_utils as scu from app.scodoc.sco_codes_parcours import UE_SPORT - +from app.scodoc import sco_cache +from app.scodoc.sco_exceptions import ScoBugCatcher from app.scodoc.sco_utils import ModuleType @@ -423,7 +424,9 @@ def moduleimpl_is_conforme( if nb_ues == 0: return False # situation absurde (pas d'UE) if len(modules_coefficients) != nb_ues: - raise ValueError("moduleimpl_is_conforme: nb ue incoherent") + # il arrive (#bug) que le cache ne soit pas à jour... + sco_cache.invalidate_formsemestre() + raise ScoBugCatcher("moduleimpl_is_conforme: nb ue incoherent") module_evals_poids = evals_poids.transpose().sum(axis=1).to_numpy() != 0 check = all( (modules_coefficients[moduleimpl.module_id].to_numpy() != 0)