From edb78efccaed24235411aba72d33463fbccbca8f Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 9 Feb 2025 16:25:09 +0100 Subject: [PATCH] handle non set condition --- changedetectionio/flask_app.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index 713163fb..e6c368f4 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -815,15 +815,10 @@ def changedetection_app(config=None, datastore_o=None): # Convert form input into JSON Logic format extra_update_obj["conditions"] = { "and": [ - { - form.conditions[i].operator.data: [ - {"var": form.conditions[i].field.data}, - form.conditions[i].value.data - ] - } - for i in range(len(form.conditions)) + {c.operator.data: [{"var": c.field.data}, c.value.data]} + for c in getattr(form, "conditions", []) or [] ] - } + } if getattr(form, "conditions", None) else {} # Because wtforms doesn't support accessing other data in process_ , but we convert the CSV list of tags back to a list of UUIDs tag_uuids = []