Use the data_store_service to set the data_store, rather than access DB directly.

Pass the label explicitly (as the value)
This commit is contained in:
mike cullerton 2021-07-15 13:09:40 -04:00
parent dd67a5e650
commit 354e20c34b
1 changed files with 4 additions and 2 deletions

View File

@ -30,6 +30,8 @@ from crc.models.study import StudyModel
from crc.models.task_event import TaskEventModel
from crc.models.user import UserModel, UserModelSchema
from crc.models.workflow import WorkflowModel, WorkflowStatus, WorkflowSpecModel
from crc.services.data_store_service import DataStoreBase
from crc.services.document_service import DocumentService
from crc.services.file_service import FileService
from crc.services.lookup_service import LookupService
@ -312,8 +314,8 @@ class WorkflowService(object):
field.get_property(Task.FIELD_PROP_FILE_DATA) in data and \
field.id in data:
file_id = data[field.get_property(Task.FIELD_PROP_FILE_DATA)]["id"]
data_store = DataStoreModel(file_id=file_id, key=field.id, value=data[field.id])
db.session.add(data_store)
data_args = (field.id, data[field.id]['label'])
DataStoreBase().set_data_common(task.id, None, None, None, None, None, file_id, *data_args)
@staticmethod
def evaluate_property(property_name, field, task):