diff --git a/app/models/modules.py b/app/models/modules.py index e3610148..2ea75b66 100644 --- a/app/models/modules.py +++ b/app/models/modules.py @@ -1,5 +1,6 @@ """ScoDoc 9 models : Modules """ +from flask import current_app from app import db from app.models import APO_CODE_STR_LEN @@ -176,7 +177,10 @@ class Module(db.Model): ue_coef_dict = { ue_id : coef } Les coefs nuls (zéro) ne sont pas stockés: la relation est supprimée. """ - if self.formation.has_locked_sems(): + if self.formation.has_locked_sems(self.ue.semestre_idx): + current_app.logguer.info( + f"set_ue_coef_dict: locked formation, ignoring request" + ) raise ScoValueError("Formation verrouillée") changed = False for ue_id, coef in ue_coef_dict.items(): @@ -204,7 +208,10 @@ class Module(db.Model): def update_ue_coef_dict(self, ue_coef_dict: dict): """update coefs vers UE (ajoute aux existants)""" - if self.formation.has_locked_sems(): + if self.formation.has_locked_sems(self.ue.semestre_idx): + current_app.logguer.info( + f"update_ue_coef_dict: locked formation, ignoring request" + ) raise ScoValueError("Formation verrouillée") current = self.get_ue_coef_dict() current.update(ue_coef_dict) @@ -216,7 +223,10 @@ class Module(db.Model): def delete_ue_coef(self, ue): """delete coef""" - if self.formation.has_locked_sems(): + if self.formation.has_locked_sems(self.ue.semestre_idx): + current_app.logguer.info( + f"delete_ue_coef: locked formation, ignoring request" + ) raise ScoValueError("Formation verrouillée") ue_coef = ModuleUECoef.query.get((self.id, ue.id)) if ue_coef: diff --git a/sco_version.py b/sco_version.py index 46167352..fecae1f6 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.4.56" +SCOVERSION = "9.4.57" SCONAME = "ScoDoc"