FileModel => DocumentModel

Don't need separate call for data
This commit is contained in:
mike cullerton 2022-04-12 13:43:00 -04:00
parent aa52b7b790
commit 0c313f44b2

View File

@ -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(