From bbdf5da2e84dff77509ded8363c1448d847e02f8 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 5 Feb 2024 11:03:34 +0100 Subject: [PATCH] Fix edition formsemestre --- app/scodoc/sco_formsemestre.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_formsemestre.py b/app/scodoc/sco_formsemestre.py index 66953733..437969eb 100644 --- a/app/scodoc/sco_formsemestre.py +++ b/app/scodoc/sco_formsemestre.py @@ -297,10 +297,11 @@ def read_formsemestre_responsables(formsemestre_id: int) -> list[int]: # py3.9+ def _write_formsemestre_responsables(sem): # TODO old, à ré-écrire avec models - sem["responsables"] = [ - uid for uid in sem["responsables"] if (uid is not None) and (uid != -1) - ] - return _write_formsemestre_aux(sem, "responsables", "responsable_id") + if sem and "responsables" in sem: + sem["responsables"] = [ + uid for uid in sem["responsables"] if (uid is not None) and (uid != -1) + ] + _write_formsemestre_aux(sem, "responsables", "responsable_id") # ---------------------- Coefs des UE