diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index b5c3d4ab..0615db1e 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -231,13 +231,17 @@ def do_ue_delete(ue_id, delete_validations=False, force=False): return None -def ue_create(formation_id=None): - """Creation d'une UE""" - return ue_edit(create=True, formation_id=formation_id) +def ue_create(formation_id=None, default_semestre_idx=None): + """Formulaire création d'une UE""" + return ue_edit( + create=True, + formation_id=formation_id, + default_semestre_idx=default_semestre_idx, + ) -def ue_edit(ue_id=None, create=False, formation_id=None): - """Modification ou création d'une UE""" +def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=None): + """Formulaire modification ou création d'une UE""" create = int(create) if not create: U = ue_list(args={"ue_id": ue_id}) @@ -250,7 +254,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None): submitlabel = "Modifier les valeurs" else: title = "Création d'une UE" - initvalues = {} + initvalues = {"semestre_idx": default_semestre_idx} submitlabel = "Créer cette UE" formation = Formation.query.get(formation_id) if not formation: diff --git a/app/templates/pn/form_ues.html b/app/templates/pn/form_ues.html index d6b1fe12..e56e1987 100644 --- a/app/templates/pn/form_ues.html +++ b/app/templates/pn/form_ues.html @@ -46,16 +46,17 @@ {% endfor %} - {% endfor %} {% if editable %}
{% endif %} + {% endfor %} \ No newline at end of file