From f6ba35c02e5e07ed60a3b9513e2d22d411af56cb Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 25 Jul 2022 14:58:06 -0400 Subject: [PATCH] fixed mypy issue --- src/spiffworkflow_backend/models/task.py | 9 --------- src/spiffworkflow_backend/scripts/script.py | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/spiffworkflow_backend/models/task.py b/src/spiffworkflow_backend/models/task.py index 2e2f8eaa..c626a61d 100644 --- a/src/spiffworkflow_backend/models/task.py +++ b/src/spiffworkflow_backend/models/task.py @@ -113,9 +113,6 @@ class Task: process_instance_id: int | None = None, form_schema: str | None = None, form_ui_schema: str | None = None, - # preceding_spiffworkflow_user_task_id: Union[str, int, None] = None, - # following_spiffworkflow_user_task_id: Union[str, int, None] = None, - # current_active_task_id: Union[int, None] = None, ): """__init__.""" self.id = id @@ -134,9 +131,6 @@ class Task: self.process_instance_id = process_instance_id self.form_schema = form_schema self.form_ui_schema = form_ui_schema - # self.preceding_spiffworkflow_user_task_id = preceding_spiffworkflow_user_task_id - # self.following_spiffworkflow_user_task_id = following_spiffworkflow_user_task_id - # self.current_active_task_id = current_active_task_id self.multi_instance_type = ( multi_instance_type # Some tasks have a repeat behavior. @@ -278,9 +272,6 @@ class TaskSchema(Schema): "process_instance_id", "form_schema", "form_ui_schema", - # "preceding_spiffworkflow_user_task_id", - # "following_spiffworkflow_user_task_id", - # "current_active_task_id", ] multi_instance_type = EnumField(MultiInstanceType) diff --git a/src/spiffworkflow_backend/scripts/script.py b/src/spiffworkflow_backend/scripts/script.py index 1724eb5c..d7a2c67a 100644 --- a/src/spiffworkflow_backend/scripts/script.py +++ b/src/spiffworkflow_backend/scripts/script.py @@ -150,6 +150,10 @@ class Script: def add_data_to_task(self, task: Task, data: Any) -> None: """Add_data_to_task.""" key = self.__class__.__name__ + + if task.data is None: + task.data = {} + if key in task.data: task.data[key].update(data) else: