Merge pull request #96 from sartography/rrt/dev
used 'name' rather than 'value' in the lookup options during validati…
This commit is contained in:
commit
199cd2cded
|
@ -157,7 +157,7 @@ class WorkflowService(object):
|
||||||
LookupDataModel.lookup_file_model == lookup_model).limit(10).all()
|
LookupDataModel.lookup_file_model == lookup_model).limit(10).all()
|
||||||
options = []
|
options = []
|
||||||
for d in data:
|
for d in data:
|
||||||
options.append({"id": d.value, "name": d.label})
|
options.append({"id": d.value, "label": d.label})
|
||||||
return random.choice(options)
|
return random.choice(options)
|
||||||
else:
|
else:
|
||||||
raise ApiError.from_task("invalid_autocomplete", "The settings for this auto complete field "
|
raise ApiError.from_task("invalid_autocomplete", "The settings for this auto complete field "
|
||||||
|
@ -294,11 +294,11 @@ class WorkflowService(object):
|
||||||
template = Template(raw_doc)
|
template = Template(raw_doc)
|
||||||
return template.render(**spiff_task.data)
|
return template.render(**spiff_task.data)
|
||||||
except jinja2.exceptions.TemplateError as ue:
|
except jinja2.exceptions.TemplateError as ue:
|
||||||
raise ApiError(code="template_error", message="Error processing template for task %s: %s" %
|
raise ApiError.from_task(code="template_error", message="Error processing template for task %s: %s" %
|
||||||
(spiff_task.task_spec.name, str(ue)), status_code=500)
|
(spiff_task.task_spec.name, str(ue)), task=spiff_task)
|
||||||
except TypeError as te:
|
except TypeError as te:
|
||||||
raise ApiError(code="template_error", message="Error processing template for task %s: %s" %
|
raise ApiError.from_task(code="template_error", message="Error processing template for task %s: %s" %
|
||||||
(spiff_task.task_spec.name, str(te)), status_code=500)
|
(spiff_task.task_spec.name, str(te)), task=spiff_task)
|
||||||
# TODO: Catch additional errors and report back.
|
# TODO: Catch additional errors and report back.
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue