From 6771a82bf2772e247b90ac161ce703acbef83160 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sun, 13 Mar 2022 09:07:36 -0600 Subject: [PATCH] Remove redundant defaults and update http logic --- frigate/events.py | 1 + frigate/http.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frigate/events.py b/frigate/events.py index b90204361..f37a23bb7 100644 --- a/frigate/events.py +++ b/frigate/events.py @@ -79,6 +79,7 @@ class EventProcessor(threading.Thread): area=event_data["area"], has_clip=event_data["has_clip"], has_snapshot=event_data["has_snapshot"], + sub_label=None, ).execute() elif event_type == "end": diff --git a/frigate/http.py b/frigate/http.py index 7fa81d7cf..839cf50fc 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -163,9 +163,9 @@ def set_sub_label(id): ) if request.json: - new_sub_label = request.json.get("subLabel", "") + new_sub_label = request.json.get("subLabel") else: - new_sub_label = "" + new_sub_label = None if new_sub_label: @@ -188,7 +188,7 @@ def delete_sub_label(id): jsonify({"success": False, "message": "Event " + id + " not found"}), 404 ) - event.sub_label = "" + event.sub_label = None event.save() return make_response( jsonify({"success": True, "message": "Event " + id + " sub label removed"}), 200