From 1e7a509879ac623b800f389d67928652031b4329 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 13 Dec 2021 19:05:31 +0100 Subject: [PATCH] Fix: edit module si pas de numero --- 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 1fff8bd4..5e804b32 100644 --- a/app/scodoc/sco_edit_module.py +++ b/app/scodoc/sco_edit_module.py @@ -124,7 +124,7 @@ def module_create(matiere_id=None, module_type=None, semestre_id=None): # cherche le numero adéquat (pour placer le module en fin de liste) modules = matiere.ue.formation.modules.all() if modules: - default_num = max([m.numero for m in modules]) + 10 + default_num = max([m.numero or 0 for m in modules]) + 10 else: default_num = 10