1
0
forked from ScoDoc/ScoDoc

edit semestre_idx des UE si NULL

This commit is contained in:
Emmanuel Viennet 2022-02-11 09:43:53 +01:00
parent be83e4d96b
commit bc4cd63ea8

View File

@ -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"""<div id="ue_list_modules">
<div><b>{ue.modules.count()} modules sont rattachés
à cette UE</b> du semestre S{ue.semestre_idx},