From bc4cd63ea85808cab57a6f717c94dc2f2eb85c3b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 11 Feb 2022 09:43:53 +0100 Subject: [PATCH] edit semestre_idx des UE si NULL --- app/scodoc/sco_edit_ue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index af045bf0..7675e45e 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -250,7 +250,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=No title = f"Modification de l'UE {ue.acronyme} {ue.titre}" initvalues = ue_dict submitlabel = "Modifier les valeurs" - can_change_semestre_id = ue.modules.count() == 0 + can_change_semestre_id = (ue.modules.count() == 0) or (ue.semestre_idx is None) else: ue = None title = "Création d'une UE" @@ -410,7 +410,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=No submitlabel=submitlabel, ) if tf[0] == 0: - if ue and ue.modules.count(): + if ue and ue.modules.count() and ue.semestre_idx is not None: modules_div = f"""
{ue.modules.count()} modules sont rattachés à cette UE du semestre S{ue.semestre_idx},