From a3ad36cc82480871178f485b6c43e171f9de5383 Mon Sep 17 00:00:00 2001 From: curo1305 Date: Mon, 1 Jun 2026 14:24:50 +0200 Subject: [PATCH] fix(06.2): CR-01 event-type filter uses prefix LIKE match instead of exact equality --- backend/api/audit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/api/audit.py b/backend/api/audit.py index f3edb6c..040b163 100644 --- a/backend/api/audit.py +++ b/backend/api/audit.py @@ -117,7 +117,7 @@ def _build_filtered_query( if user_id is not None: q = q.where(AuditLog.user_id == user_id) if event_type is not None: - q = q.where(AuditLog.event_type == event_type) + q = q.where(AuditLog.event_type.like(f"{event_type}%")) return q @@ -156,7 +156,7 @@ def _build_filtered_query_with_handles( if user_uuid is not None: q = q.where(AuditLog.user_id == user_uuid) if event_type is not None: - q = q.where(AuditLog.event_type == event_type) + q = q.where(AuditLog.event_type.like(f"{event_type}%")) return q @@ -281,7 +281,7 @@ async def list_audit_log( if user_uuid is not None: count_q = count_q.where(AuditLog.user_id == user_uuid) if event_type is not None: - count_q = count_q.where(AuditLog.event_type == event_type) + count_q = count_q.where(AuditLog.event_type.like(f"{event_type}%")) count_result = await session.execute(count_q) total = count_result.scalar_one()