mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-07 00:06:57 +01:00
fix DoesNotExist exception
This commit is contained in:
parent
2fbfbf614b
commit
de121008c1
@ -234,9 +234,9 @@ def event_snapshot(id):
|
|||||||
def event_clip(id):
|
def event_clip(id):
|
||||||
download = request.args.get("download", type=bool)
|
download = request.args.get("download", type=bool)
|
||||||
|
|
||||||
|
try:
|
||||||
event: Event = Event.get(Event.id == id)
|
event: Event = Event.get(Event.id == id)
|
||||||
|
except DoesNotExist:
|
||||||
if event is None:
|
|
||||||
return "Event not found.", 404
|
return "Event not found.", 404
|
||||||
|
|
||||||
if not event.has_clip:
|
if not event.has_clip:
|
||||||
@ -689,9 +689,9 @@ def vod_hour(year_month, day, hour, camera):
|
|||||||
|
|
||||||
@bp.route("/vod/event/<id>")
|
@bp.route("/vod/event/<id>")
|
||||||
def vod_event(id):
|
def vod_event(id):
|
||||||
|
try:
|
||||||
event: Event = Event.get(Event.id == id)
|
event: Event = Event.get(Event.id == id)
|
||||||
|
except DoesNotExist:
|
||||||
if event is None:
|
|
||||||
return "Event not found.", 404
|
return "Event not found.", 404
|
||||||
|
|
||||||
if not event.has_clip:
|
if not event.has_clip:
|
||||||
|
Loading…
Reference in New Issue
Block a user