From bb9995fca63ccbf9434290a79d203ff40b7dd46f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 16 Nov 2023 11:08:48 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20formulaire=20cr=C3=A9ation=20formseemstr?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_formsemestre_edit.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py index 42bc71b3e..257cbae19 100644 --- a/app/scodoc/sco_formsemestre_edit.py +++ b/app/scodoc/sco_formsemestre_edit.py @@ -986,10 +986,11 @@ def do_formsemestre_createwithmodules(edit=False, formsemestre: FormSemestre = N for parcour_id_str in tf[2]["parcours"] ] # --- Id edt du groupe par défault - group_tous = formsemestre.get_default_group() - if group_tous: - group_tous.edt_id = tf[2]["edt_promo_id"] - db.session.add(group_tous) + if "edt_promo_id" in tf[2]: + group_tous = formsemestre.get_default_group() + if group_tous: + group_tous.edt_id = tf[2]["edt_promo_id"] + db.session.add(group_tous) db.session.add(formsemestre) db.session.commit()