]> git.ipfire.org Git - dbl.git/commitdiff
api: Remove the deprecated calls to fetch reports
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 3 Mar 2026 14:36:34 +0000 (14:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 3 Mar 2026 14:36:34 +0000 (14:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dbl/api/lists.py

index 563e09d460d621a0e6f564338be8c859fce256cd..5e4b1b1f51cae27689631e286fd4bf6a3203bb08 100644 (file)
@@ -76,17 +76,6 @@ async def get_list_history(
 async def get_list_sources(list = fastapi.Depends(get_list_from_path)) -> typing.List[sources.Source]:
        return list.sources
 
-@router.get("/{list}/reports", deprecated=True)
-async def get_list_reports(
-               list = fastapi.Depends(get_list_from_path),
-               open: bool | None = None,
-               name: str | None = None,
-               limit: int | None = None
-) -> typing.List[reports.Report]:
-       reports = backend.reports.get(list=list, open=open, name=name, limit=limit)
-
-       return [report async for report in reports]
-
 @router.get("/{list}/domains/{name}")
 async def get_list_domains(
                name: str, list = fastapi.Depends(get_list_from_path),
@@ -94,30 +83,5 @@ async def get_list_domains(
        # Fetch the domain history
        return [e async for e in list.get_domain_history(name)]
 
-
-class CreateReport(pydantic.BaseModel):
-       # Domain
-       name : str
-
-       # Comment
-       comment : str = ""
-
-       # Block?
-       block : bool = True
-
-
-@router.post("/{list}/reports", deprecated=True)
-async def list_report(
-       report: CreateReport,
-       list = fastapi.Depends(get_list_from_path),
-       user = fastapi.Depends(require_current_user),
-) -> reports.Report:
-       return await list.report(
-               name        = report.name,
-               reported_by = user,
-               comment     = report.comment,
-               block       = report.block,
-       )
-
 # Include our endpoints
 app.include_router(router)