From c8bf8309e85b14c2b36913469a38291f2c480b53 Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Wed, 9 Oct 2024 20:57:40 +0300 Subject: [PATCH] skip scripts with no modules Signed-off-by: Alexander Piskun --- CHANGELOG.md | 3 ++- ex_app/lib/main.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1047eb9..b8ac1ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Unregister webhooks from the Nextcloud instance during ExApp disabling. +- Incorrect handling Windmill scripts with no modules in it. #11 +- Unregister webhooks from the Nextcloud instance during ExApp disabling. #10 ## [1.0.0 - 2024-09-13] diff --git a/ex_app/lib/main.py b/ex_app/lib/main.py index d2049c3..fdf103d 100644 --- a/ex_app/lib/main.py +++ b/ex_app/lib/main.py @@ -422,6 +422,9 @@ def get_expected_listeners(workspace: str, token: str, flow_paths: list[str]) -> except json.JSONDecodeError: LOGGER.exception("Error parsing JSON", stack_info=True) return [] + if not response_data["value"].get("modules", []): + LOGGER.debug("Flow %s has no modules in it, skipping,", flow_path) + return flows first_module = response_data["value"]["modules"][0] if ( first_module.get("summary", "") == "CORE:LISTEN_TO_EVENT"