Saves form field key
This commit is contained in:
parent
0a3a932c50
commit
b0b1a6e5e8
|
@ -36,7 +36,7 @@ def add_file(workflow_spec_id=None, study_id=None, workflow_id=None, task_id=Non
|
|||
if workflow_spec_id:
|
||||
file_model = FileService.add_workflow_spec_file(workflow_spec_id, file.filename, file.content_type, file.stream.read())
|
||||
else:
|
||||
file_model = FileService.add_task_file(study_id, workflow_id, task_id, file.filename, file.content_type, file.stream.read())
|
||||
file_model = FileService.add_form_field_file(study_id, workflow_id, task_id, form_field_key, file.filename, file.content_type, file.stream.read())
|
||||
|
||||
return FileModelSchema().dump(file_model)
|
||||
|
||||
|
|
|
@ -22,6 +22,19 @@ class FileService(object):
|
|||
)
|
||||
return FileService.update_file(file_model, binary_data, content_type)
|
||||
|
||||
@staticmethod
|
||||
def add_form_field_file(study_id, workflow_id, task_id, form_field_key, name, content_type, binary_data):
|
||||
"""Create a new file and associate it with a user task form field within a workflow."""
|
||||
file_model = FileModel(
|
||||
version=0,
|
||||
study_id=study_id,
|
||||
workflow_id=workflow_id,
|
||||
task_id=task_id,
|
||||
name=name,
|
||||
form_field_key=form_field_key
|
||||
)
|
||||
return FileService.update_file(file_model, binary_data, content_type)
|
||||
|
||||
@staticmethod
|
||||
def add_task_file(study_id, workflow_id, task_id, name, content_type, binary_data):
|
||||
"""Create a new file and associate it with an executing task within a workflow."""
|
||||
|
|
Loading…
Reference in New Issue