From 912ee8b4dab975263f7ac0de0413e646c75ab26f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 2 Mar 2022 16:31:42 +0100 Subject: [PATCH] Fix: modimpls_sorted --- app/models/formsemestre.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/formsemestre.py b/app/models/formsemestre.py index a6411f70f..41ede854f 100644 --- a/app/models/formsemestre.py +++ b/app/models/formsemestre.py @@ -206,7 +206,11 @@ class FormSemestre(db.Model): modimpls = self.modimpls.all() if self.formation.is_apc(): modimpls.sort( - key=lambda m: (m.module.module_type, m.module.numero, m.module.code) + key=lambda m: ( + m.module.module_type or 0, + m.module.numero or 0, + m.module.code or 0, + ) ) else: modimpls.sort(