Fix history origin filter path and add regression tests

This commit is contained in:
2026-03-22 20:32:40 +01:00
parent a32cc82851
commit cf721513e8
5 changed files with 129 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ import structlog
if TYPE_CHECKING:
from app.models.geo import GeoEnricher
from app.models.ban import TIME_RANGE_SECONDS, TimeRange
from app.models.ban import TIME_RANGE_SECONDS, BanOrigin, TimeRange
from app.models.history import (
HistoryBanItem,
HistoryListResponse,
@@ -62,6 +62,7 @@ async def list_history(
range_: TimeRange | None = None,
jail: str | None = None,
ip_filter: str | None = None,
origin: BanOrigin | None = None,
page: int = 1,
page_size: int = _DEFAULT_PAGE_SIZE,
geo_enricher: GeoEnricher | None = None,
@@ -108,6 +109,7 @@ async def list_history(
since=since,
jail=jail,
ip_filter=ip_filter,
origin=origin,
page=page,
page_size=effective_page_size,
)