From 0c313f44b2ca85590dd5748650d6638f07e501fe Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Tue, 12 Apr 2022 13:43:00 -0400 Subject: [PATCH] FileModel => DocumentModel Don't need separate call for data --- crc/scripts/complete_template.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crc/scripts/complete_template.py b/crc/scripts/complete_template.py index d3b1751a..395e83ad 100644 --- a/crc/scripts/complete_template.py +++ b/crc/scripts/complete_template.py @@ -5,7 +5,7 @@ from SpiffWorkflow.exceptions import WorkflowTaskExecException from crc import session from crc.api.common import ApiError -from crc.models.file import CONTENT_TYPES, FileModel +from crc.models.file import CONTENT_TYPES, DocumentModel from crc.models.workflow import WorkflowModel from crc.scripts.script import Script from crc.services.jinja_service import JinjaService @@ -99,10 +99,9 @@ Takes two arguments: if file_id is not None and isinstance(file_id, int): if not task.workflow.data[WorkflowProcessor.VALIDATION_PROCESS_KEY]: # Get the actual image data - image_file_model = session.query(FileModel).filter_by(id=file_id).first() - image_file_data_model = UserFileService.get_file_data(file_id, image_file_model) - if image_file_data_model is not None: - image_file_data.append(image_file_data_model) + image_file_model = session.query(DocumentModel).filter_by(id=file_id).first() + if image_file_model is not None: + image_file_data.append(image_file_model) else: raise ApiError(