Merge pull request #219 from sartography/fix-api-call-missing-fieldname-143
Fixed ApiError call. Now includes task_id and task_name.
This commit is contained in:
commit
be288ae048
|
@ -130,7 +130,9 @@ class WorkflowService(object):
|
||||||
# Assure we have a field type
|
# Assure we have a field type
|
||||||
if field.type is None:
|
if field.type is None:
|
||||||
raise ApiError(code='invalid_form_data',
|
raise ApiError(code='invalid_form_data',
|
||||||
message='Field type is None. A field type must be provided.')
|
message=f'Type is missing for field "{field.id}". A field type must be provided.',
|
||||||
|
task_id=task.id,
|
||||||
|
task_name=task.get_name())
|
||||||
# Assure field has valid properties
|
# Assure field has valid properties
|
||||||
WorkflowService.check_field_properties(field, task)
|
WorkflowService.check_field_properties(field, task)
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,5 @@ class TestFormFieldType(BaseTest):
|
||||||
|
|
||||||
json_data = json.loads(rv.get_data(as_text=True))
|
json_data = json.loads(rv.get_data(as_text=True))
|
||||||
self.assertEqual(json_data[0]['message'],
|
self.assertEqual(json_data[0]['message'],
|
||||||
'When populating all fields ... Field type is None. A field type must be provided.')
|
'When populating all fields ... Type is missing for field "name". A field type must be provided.')
|
||||||
# print('TestFormFieldType: Good Form')
|
# print('TestFormFieldType: Good Form')
|
||||||
|
|
Loading…
Reference in New Issue