Do not fail if a single event is not found

This commit is contained in:
Nicolas Mowen 2025-10-07 09:17:17 -06:00
parent f3ce503f76
commit 03cbe650f8

View File

@ -434,10 +434,8 @@ async def event_ids(ids: str, request: Request):
event = Event.get(Event.id == event_id) event = Event.get(Event.id == event_id)
await require_camera_access(event.camera, request=request) await require_camera_access(event.camera, request=request)
except DoesNotExist: except DoesNotExist:
return JSONResponse( # we should not fail the entire request if an event is not found
content=({"success": False, "message": f"Event {event_id} not found"}), continue
status_code=404,
)
try: try:
events = Event.select().where(Event.id << ids).dicts().iterator() events = Event.select().where(Event.id << ids).dicts().iterator()