From 52dfa16a69f6e7cf7871cdf18a3c1d6ddb150ec9 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 19 Feb 2023 13:35:45 +0100 Subject: [PATCH] Fix exception si module sans matiere --- app/scodoc/sco_edit_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scodoc/sco_edit_module.py b/app/scodoc/sco_edit_module.py index 5014435d4..4d963c6e4 100644 --- a/app/scodoc/sco_edit_module.py +++ b/app/scodoc/sco_edit_module.py @@ -321,7 +321,7 @@ def module_edit( matieres = [ mat for mat in matieres - if ((module is not None) and (module.matiere.id == mat.id)) + if (module and module.matiere and (module.matiere.id == mat.id)) or (mat.id == mat.ue.matieres.first().id) ] mat_names = [