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"""