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()