fix: clamp limit to 0 minimum to prevent negative limit values

This commit is contained in:
cal 2026-03-24 12:08:15 +00:00
parent 426d559387
commit ac8ec4b283

View File

@ -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: