check the value of FileType instead of the string form w/ burnettk

This commit is contained in:
jasquat 2022-09-12 16:48:30 -04:00
parent 6eef611095
commit 5524062702
2 changed files with 1 additions and 6 deletions

View File

@ -296,11 +296,6 @@ def add_file(process_group_id: str, process_model_id: str) -> flask.wrappers.Res
file.file_contents = file_contents
file.process_model_id = process_model.id
file.process_group_id = process_model.process_group_id
if not process_model.primary_process_id and file.type == FileType.bpmn.value:
SpecFileService.process_bpmn_file(
process_model, file.name, set_primary_file=True
)
process_model_service.save_process_model(process_model)
return Response(
json.dumps(FileSchema().dump(file)), status=201, mimetype="application/json"
)

View File

@ -74,7 +74,7 @@ class SpecFileService(FileSystemService):
SpecFileService.write_file_data_to_system(file_path, binary_data)
file = SpecFileService.to_file_object(file_name, file_path)
if file.type == str(FileType.bpmn):
if file.type == FileType.bpmn.value:
set_primary_file = False
if (
process_model_info.primary_file_name is None