fix(06.2): CR-01 event-type filter uses prefix LIKE match instead of exact equality

This commit is contained in:
curo1305
2026-06-01 14:24:50 +02:00
parent 7e549b6312
commit a3ad36cc82
+3 -3
View File
@@ -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()