diff --git a/frigate/http.py b/frigate/http.py index ba62af047..fe5da869a 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -420,8 +420,8 @@ def get_labels(): else: events = Event.select(Event.label).distinct() except Exception as e: - return jsonify( - {"success": False, "message": f"Failed to get labels: {e}"}, "404" + return make_response( + jsonify({"success": False, "message": f"Failed to get labels: {e}"}), 404 ) labels = sorted([e.label for e in events]) @@ -435,8 +435,9 @@ def get_sub_labels(): try: events = Event.select(Event.sub_label).distinct() except Exception as e: - return jsonify( - {"success": False, "message": f"Failed to get sub_labels: {e}"}, "404" + return make_response( + jsonify({"success": False, "message": f"Failed to get sub_labels: {e}"}), + 404, ) sub_labels = [e.sub_label for e in events] @@ -869,12 +870,17 @@ def events(): @bp.route("/events//