Fix: modimpls_sorted

This commit is contained in:
Emmanuel Viennet 2022-03-02 16:31:42 +01:00
parent 750744094e
commit 912ee8b4da

View File

@ -206,7 +206,11 @@ class FormSemestre(db.Model):
modimpls = self.modimpls.all() modimpls = self.modimpls.all()
if self.formation.is_apc(): if self.formation.is_apc():
modimpls.sort( 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: else:
modimpls.sort( modimpls.sort(