From 483fabc606948aa4448ce565dee1c229bb643c8e Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 31 Oct 2022 16:52:44 -0400 Subject: [PATCH] updated backend to send instructions for user tasks through jinja as well w/ burnettk danfunk --- .../routes/process_api_blueprint.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index 7c7643bf9..f2ffec20f 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -1069,12 +1069,13 @@ def task_show(process_instance_id: int, task_id: str) -> flask.wrappers.Response ) if ui_form_contents: task.form_ui_schema = ui_form_contents - elif task.type == "Manual Task": - if task.properties and task.data: - if task.properties["instructionsForEndUser"]: - task.properties["instructionsForEndUser"] = render_jinja_template( - task.properties["instructionsForEndUser"], task.data - ) + + if task.properties and task.data and "instructionsForEndUser" in task.properties: + print(f"task.properties['instructionsForEndUser']: {task.properties['instructionsForEndUser']}") + if task.properties["instructionsForEndUser"]: + task.properties["instructionsForEndUser"] = render_jinja_template( + task.properties["instructionsForEndUser"], task.data + ) return make_response(jsonify(task), 200)