From ac8ec4b283980d6bd779fda23d6c2264901a664d Mon Sep 17 00:00:00 2001 From: cal Date: Tue, 24 Mar 2026 12:08:15 +0000 Subject: [PATCH] fix: clamp limit to 0 minimum to prevent negative limit values --- app/routers_v2/notifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routers_v2/notifications.py b/app/routers_v2/notifications.py index 9518dad..7a6053c 100644 --- a/app/routers_v2/notifications.py +++ b/app/routers_v2/notifications.py @@ -35,7 +35,7 @@ async def get_notifs( limit: Optional[int] = 100, ): if limit is not None: - limit = min(limit, 500) + limit = max(0, min(limit, 500)) all_notif = Notification.select().order_by(Notification.id) if all_notif.count() == 0: