fix: make filter.lightning.type optional in nowcast filter config

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.
This commit is contained in:
2026-09-15 13:23:47 +03:00
parent f7dd311da4
commit 91839e56a9
+6 -2
View File
@@ -120,9 +120,13 @@ def load_nowcast_geo_alarm_filter(path: Path) -> dict[str, Any]:
if not isinstance(lightning, dict): if not isinstance(lightning, dict):
raise ConfigurationError("filter.lightning JSON nesnesi olmalıdır.") raise ConfigurationError("filter.lightning JSON nesnesi olmalıdır.")
event_type = lightning.get("type") 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( 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") thunderstorm = config.get("thunderstorm")