From a0268f52b9759765e15c834af30e5438d1914692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 7 Sep 2023 21:18:08 +0000 Subject: [PATCH] sort doors on set --- api/advent22_api/routers/general.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/advent22_api/routers/general.py b/api/advent22_api/routers/general.py index 7b2cf3b..c156c50 100644 --- a/api/advent22_api/routers/general.py +++ b/api/advent22_api/routers/general.py @@ -45,5 +45,8 @@ async def put_doors( Türchen setzen """ - cfg.puzzle.doors = doors + cfg.puzzle.doors = sorted( + doors, + key=lambda door: door.day, + ) await set_config(cfg)