From 7e5ccfb2d83b7ae4da63fbc21317962b6eb09f82 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 12 Apr 2022 17:21:58 +0200 Subject: [PATCH] Fixes #359 --- app/scodoc/sco_formsemestre_edit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py index 3c88ff706..c6d9de0ee 100644 --- a/app/scodoc/sco_formsemestre_edit.py +++ b/app/scodoc/sco_formsemestre_edit.py @@ -191,10 +191,10 @@ def do_formsemestre_createwithmodules(edit=False): modimpl.responsable_id, f"inconnu numéro {modimpl.responsable_id} resp. de {modimpl.id} !", ) - - initvalues["responsable_id"] = uid2display.get( - sem["responsables"][0], sem["responsables"][0] - ) + if sem["responsables"]: + initvalues["responsable_id"] = uid2display.get( + sem["responsables"][0], sem["responsables"][0] + ) if len(sem["responsables"]) > 1: initvalues["responsable_id2"] = uid2display.get( sem["responsables"][1], sem["responsables"][1]