From 3f23cb74a631b19d500550fd410165b158614a75 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 14 Feb 2022 10:28:37 +0100 Subject: [PATCH] Fix: bug Cergy (module type) --- app/scodoc/sco_edit_module.py | 10 +++------- sco_version.py | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/scodoc/sco_edit_module.py b/app/scodoc/sco_edit_module.py index a0c7b81f2..f7b25989e 100644 --- a/app/scodoc/sco_edit_module.py +++ b/app/scodoc/sco_edit_module.py @@ -41,7 +41,6 @@ from app.models import FormSemestre, ModuleImpl import app.scodoc.notesdb as ndb import app.scodoc.sco_utils as scu -from app.scodoc.sco_utils import ModuleType from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc.sco_permissions import Permission from app.scodoc.sco_exceptions import ( @@ -196,7 +195,6 @@ def module_create( }, ), ] - semestres_indices = list(range(1, parcours.NB_SEM + 1)) if is_apc: module_types = scu.ModuleType # tous les types @@ -451,8 +449,6 @@ def module_delete(module_id=None): def do_module_edit(vals: dict) -> None: "edit a module" - from app.scodoc import sco_edit_formation - # check mod = module_list({"module_id": vals["module_id"]})[0] if module_is_locked(mod["module_id"]): @@ -546,7 +542,7 @@ def module_edit(module_id=None): # ne propose pas SAE et Ressources, sauf si déjà de ce type... module_types = ( set(scu.ModuleType) - {scu.ModuleType.RESSOURCE, scu.ModuleType.SAE} - ) | {a_module.module_type} + ) | {a_module.module_type or scu.ModuleType.STANDARD} descr = [ ( @@ -845,7 +841,7 @@ def formation_add_malus_modules(formation_id, titre=None, redirect=True): [ mod for mod in module_list(args={"ue_id": ue["ue_id"]}) - if mod["module_type"] == ModuleType.MALUS + if mod["module_type"] == scu.ModuleType.MALUS ] ) if nb_mod_malus == 0: @@ -897,7 +893,7 @@ def ue_add_malus_module(ue_id, titre=None, code=None): "matiere_id": matiere_id, "formation_id": ue["formation_id"], "semestre_id": semestre_id, - "module_type": ModuleType.MALUS, + "module_type": scu.ModuleType.MALUS, }, ) diff --git a/sco_version.py b/sco_version.py index 1a4e27e60..23fba0069 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.55" +SCOVERSION = "9.1.56" SCONAME = "ScoDoc"