runtime_info can be None so check for it w/ burnettk

This commit is contained in:
jasquat 2023-09-07 15:11:06 -04:00
parent 4cf33b62fc
commit 3ba3b5448a
2 changed files with 7 additions and 3 deletions

View File

@ -65,8 +65,8 @@ class TaskModel(SpiffworkflowBaseDBModel):
json_data_hash: str = db.Column(db.String(255), nullable=False, index=True)
python_env_data_hash: str = db.Column(db.String(255), nullable=False, index=True)
runtime_info: dict = db.Column(db.JSON)
runtime_info: dict | None = db.Column(db.JSON)
start_in_seconds: float | None = db.Column(db.DECIMAL(17, 6))
end_in_seconds: float | None = db.Column(db.DECIMAL(17, 6))

View File

@ -500,7 +500,9 @@ def process_instance_task_list(
task_models_of_parent_bpmn_processes,
) = TaskService.task_models_of_parent_bpmn_processes(to_task_model)
task_models_of_parent_bpmn_processes_guids = [p.guid for p in task_models_of_parent_bpmn_processes if p.guid]
if "instance" in to_task_model.runtime_info or "iteration" in to_task_model.runtime_info:
if to_task_model.runtime_info and (
"instance" in to_task_model.runtime_info or "iteration" in to_task_model.runtime_info
):
to_task_model_parent = [to_task_model.properties_json["parent"]]
else:
to_task_model_parent = []
@ -579,7 +581,9 @@ def process_instance_task_list(
most_recent_tasks[row_key] = task_model
if task_model.typename in ["SubWorkflowTask", "CallActivity"]:
relevant_subprocess_guids.add(task_model.guid)
elif "instance" in task_model.runtime_info or "iteration" in task_model.runtime_info:
elif task_model.runtime_info and (
"instance" in task_model.runtime_info or "iteration" in task_model.runtime_info
):
# This handles adding all instances of a MI and iterations of loop tasks
additional_tasks.append(task_model)