From b6bf843f6e0b8c7de6552caa5fdd62e264770ef1 Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Mon, 1 Jun 2020 11:00:56 -0400 Subject: [PATCH] used 'name' rather than 'value' in the lookup options during validation, causing a disconnect with how this is processed on the front end. --- crc/services/workflow_service.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index 03a23aac..312dee3c 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -157,7 +157,7 @@ class WorkflowService(object): LookupDataModel.lookup_file_model == lookup_model).limit(10).all() options = [] for d in data: - options.append({"id": d.value, "name": d.label}) + options.append({"id": d.value, "label": d.label}) return random.choice(options) else: raise ApiError.from_task("invalid_autocomplete", "The settings for this auto complete field " @@ -294,11 +294,11 @@ class WorkflowService(object): template = Template(raw_doc) return template.render(**spiff_task.data) except jinja2.exceptions.TemplateError as ue: - raise ApiError(code="template_error", message="Error processing template for task %s: %s" % - (spiff_task.task_spec.name, str(ue)), status_code=500) + raise ApiError.from_task(code="template_error", message="Error processing template for task %s: %s" % + (spiff_task.task_spec.name, str(ue)), task=spiff_task) except TypeError as te: - raise ApiError(code="template_error", message="Error processing template for task %s: %s" % - (spiff_task.task_spec.name, str(te)), status_code=500) + raise ApiError.from_task(code="template_error", message="Error processing template for task %s: %s" % + (spiff_task.task_spec.name, str(te)), task=spiff_task) # TODO: Catch additional errors and report back. @staticmethod