From 9578c789dcac5715329801ad0a821eedc83eddd3 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 16 Sep 2021 00:16:50 +0200 Subject: [PATCH] Fix sort groupe (#py3) --- app/scodoc/sco_groups.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index 18c53e734..5277ea5a0 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -1499,7 +1499,7 @@ def _sortgroups(groups): # Tri: place 'all' en tĂȘte, puis groupe par partition / nom de groupe R = [g for g in groups if g["partition_name"] is None] o = [g for g in groups if g["partition_name"] != None] - o.sort(key=lambda x: (x["numero"], x["group_name"])) + o.sort(key=lambda x: (x["numero"] or 0, x["group_name"])) return R + o