We now make sure that forms have a form key. Ticket 163

This commit is contained in:
mike cullerton 2021-01-22 12:14:17 -05:00
parent 5b13195182
commit b71fd93dd4
1 changed files with 6 additions and 0 deletions

View File

@ -108,6 +108,12 @@ class WorkflowService(object):
task_api = WorkflowService.spiff_task_to_api_task(
task,
add_docs_and_forms=True) # Assure we try to process the documentation, and raise those errors.
# make sure forms have a form key
if hasattr(task_api, 'form') and task_api.form is not None and task_api.form.key == '':
raise ApiError(code='missing_form_key',
message='Forms must include a Form Key.',
task_id=task.id,
task_name=task.get_name())
WorkflowService.populate_form_with_random_data(task, task_api, required_only)
processor.complete_task(task)
except WorkflowException as we: