From 050c8408d9094403593ff180b1e080c9671ad21e Mon Sep 17 00:00:00 2001 From: penner Date: Sun, 10 Sep 2023 15:12:58 +0000 Subject: [PATCH] No negative Days --- api/advent22_api/routers/_security.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/advent22_api/routers/_security.py b/api/advent22_api/routers/_security.py index e2c828e..24d4686 100644 --- a/api/advent22_api/routers/_security.py +++ b/api/advent22_api/routers/_security.py @@ -57,4 +57,7 @@ async def user_can_view_door( True iff das Türchen von Tag `day` user-sichtbar ist """ + if day < 0: + raise HTTPException(status.HTTP_422_UNPROCESSABLE_ENTITY) + return day < await user_visible_doors()