From 91839e56a92dccac82a9cc3481f53cf762da71eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=96ZDEM=C4=B0R?= Date: Tue, 15 Sep 2026 13:23:47 +0300 Subject: [PATCH] fix: make filter.lightning.type optional in nowcast filter config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backend already treats a missing/null lightning.type as "no type constraint", but the sandbox validator required it whenever a lightning block was present, causing valid configs to be rejected with "filter.lightning.type FLASH_CLOUD_TO_GROUND veya PULSE_IN_CLOUD olmalıdır." Now the check only rejects an explicitly invalid value. --- geo_alarm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/geo_alarm.py b/geo_alarm.py index 138248b..83b38da 100644 --- a/geo_alarm.py +++ b/geo_alarm.py @@ -120,9 +120,13 @@ def load_nowcast_geo_alarm_filter(path: Path) -> dict[str, Any]: if not isinstance(lightning, dict): raise ConfigurationError("filter.lightning JSON nesnesi olmalıdır.") event_type = lightning.get("type") - if event_type not in {"FLASH_CLOUD_TO_GROUND", "PULSE_IN_CLOUD"}: + if event_type is not None and event_type not in { + "FLASH_CLOUD_TO_GROUND", + "PULSE_IN_CLOUD", + }: raise ConfigurationError( - "filter.lightning.type FLASH_CLOUD_TO_GROUND veya PULSE_IN_CLOUD olmalıdır." + "filter.lightning.type belirtilirse FLASH_CLOUD_TO_GROUND veya " + "PULSE_IN_CLOUD olmalıdır." ) thunderstorm = config.get("thunderstorm")