diff --git a/crc/api/spec_file.py b/crc/api/spec_file.py index c24437a4..9d3b5d85 100644 --- a/crc/api/spec_file.py +++ b/crc/api/spec_file.py @@ -40,7 +40,7 @@ def add_file(spec_id): workflow_spec = workflow_spec_service.get_spec(spec_id) file = connexion.request.files['file'] 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) workflow_spec_service.update_spec(workflow_spec) return FileSchema().dump(file) diff --git a/crc/models/file.py b/crc/models/file.py index 6ba2757c..d0939b58 100644 --- a/crc/models/file.py +++ b/crc/models/file.py @@ -148,7 +148,7 @@ class File(object): instance = cls() instance.name = file_name instance.content_type = content_type - instance.type = file_type + instance.type = file_type.value instance.document = {} instance.last_modified = last_modified instance.size = file_size