From: Michael Tremer Date: Tue, 3 Mar 2026 14:53:39 +0000 (+0000) Subject: api: Don't try to search for a list if none exists X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2d3ccc6e16e37b78279aeedc1f7b05364e07893;p=dbl.git api: Don't try to search for a list if none exists Signed-off-by: Michael Tremer --- diff --git a/src/dbl/api/reports.py b/src/dbl/api/reports.py index 9eedb17..f6bee18 100644 --- a/src/dbl/api/reports.py +++ b/src/dbl/api/reports.py @@ -85,9 +85,10 @@ async def get_reports( limit: int | None = None, ) -> typing.List[reports.Report]: # Fetch the list - list = await backend.lists.get_by_slug(list) - if not list: - raise fastapi.HTTPException(400, "Could not find list '%s'" % list) + if list: + list = await backend.lists.get_by_slug(list) + if not list: + raise fastapi.HTTPException(400, "Could not find list '%s'" % list) # Fetch all reports reports = backend.reports.get(