We now store type as a string, not an Enum

This commit is contained in:
mike cullerton 2022-04-15 10:23:00 -04:00
parent ba2eef0ec9
commit 9097851ae1
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ def add_file(spec_id):
workflow_spec = workflow_spec_service.get_spec(spec_id) workflow_spec = workflow_spec_service.get_spec(spec_id)
file = connexion.request.files['file'] file = connexion.request.files['file']
file = SpecFileService.add_file(workflow_spec, file.filename, file.stream.read()) file = SpecFileService.add_file(workflow_spec, file.filename, file.stream.read())
if not workflow_spec.primary_process_id and file.type == FileType.bpmn: if not workflow_spec.primary_process_id and file.type == FileType.bpmn.value:
SpecFileService.set_primary_bpmn(workflow_spec, file.name) SpecFileService.set_primary_bpmn(workflow_spec, file.name)
workflow_spec_service.update_spec(workflow_spec) workflow_spec_service.update_spec(workflow_spec)
return FileSchema().dump(file) return FileSchema().dump(file)

View File

@ -148,7 +148,7 @@ class File(object):
instance = cls() instance = cls()
instance.name = file_name instance.name = file_name
instance.content_type = content_type instance.content_type = content_type
instance.type = file_type instance.type = file_type.value
instance.document = {} instance.document = {}
instance.last_modified = last_modified instance.last_modified = last_modified
instance.size = file_size instance.size = file_size