From 715d7aa9ee89ef02297167a79fc53c247ec4cca5 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 27 Jan 2022 00:18:50 +0100 Subject: [PATCH] 9.1.35 --- app/scodoc/sco_edit_ue.py | 12 ++++++++++-- sco_version.py | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index c9a2da171..1de9969ef 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -33,13 +33,15 @@ from flask import url_for, render_template from flask import g, request from flask_login import current_user +from app import db +from app import log from app.models import APO_CODE_STR_LEN from app.models import Formation, UniteEns, ModuleImpl, Module +from app.models.formations import Matiere import app.scodoc.notesdb as ndb import app.scodoc.sco_utils as scu from app.scodoc.sco_utils import ModuleType -from app import log -from app.scodoc.TrivialFormulator import TrivialFormulator, TF +from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc.gen_tables import GenTable from app.scodoc.sco_permissions import Permission from app.scodoc.sco_exceptions import ( @@ -533,6 +535,12 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list # pour faciliter la transition des anciens programmes non APC for ue in ues_obj: ue.guess_semestre_idx() + # vérifie qu'on a bien au moins une matière dans chaque UE + for ue in ues_obj: + if ue.matieres.count() < 1: + mat = Matiere(ue_id=ue.id) + db.session.add(mat) + db.session.commit() ues = [ue.to_dict() for ue in ues_obj] ues_externes = [ue.to_dict() for ue in ues_externes_obj] diff --git a/sco_version.py b/sco_version.py index 8ef59e41f..00415b082 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.34" +SCOVERSION = "9.1.35" SCONAME = "ScoDoc"