From 9d09a76e5db2f0e38a7c01ebf44dc1729bc04039 Mon Sep 17 00:00:00 2001 From: Tal Date: Wed, 11 Sep 2024 18:06:03 +0300 Subject: [PATCH] fix: workflow interval can be None (#1904) --- keep/api/models/workflow.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/keep/api/models/workflow.py b/keep/api/models/workflow.py index 26d28f2e1..6beb16c80 100644 --- a/keep/api/models/workflow.py +++ b/keep/api/models/workflow.py @@ -28,7 +28,7 @@ class WorkflowDTO(BaseModel): created_by: str creation_time: datetime triggers: List[dict] = None - interval: int + interval: int | None = None disabled: bool = False last_execution_time: datetime = None last_execution_status: str = None @@ -70,7 +70,14 @@ def manipulate_raw(cls, raw, values): ordered_raw["disabled"] = d.get("disabled") ordered_raw["triggers"] = d.get("triggers") for key, val in d.items(): - if key not in ["id", "description", "disabled", "triggers", "steps", "actions"]: + if key not in [ + "id", + "description", + "disabled", + "triggers", + "steps", + "actions", + ]: ordered_raw[key] = val # than steps and actions ordered_raw["steps"] = d.get("steps")