fix events accidently pulling inside chroma results loop

This commit is contained in:
Jason Hunter 2024-06-22 22:04:11 -04:00
parent 602a49ee3d
commit 9bc6ae4771

View File

@ -399,17 +399,16 @@ def events_search():
else "description",
}
if not results:
return jsonify([])
# Get the event data
events = (
Event.select(*selected_columns)
.join(
ReviewSegment,
JOIN.LEFT_OUTER,
on=(
fn.json_extract(ReviewSegment.data, "$.detections").contains(
Event.id
)
),
on=(fn.json_extract(ReviewSegment.data, "$.detections").contains(Event.id)),
)
.where(Event.id << list(results.keys()))
.dicts()