diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py index cbe007d63..523060620 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/file_system_service.py @@ -31,10 +31,17 @@ class FileSystemService: app_root = current_app.root_path return os.path.join(app_root, "..", dir_name) + @staticmethod + def id_string_to_relative_path(id_string): + return id_string.replace("/", os.sep) + @staticmethod def process_group_path(name: str) -> str: """Category_path.""" - return os.path.abspath(os.path.join(FileSystemService.root_path(), name)) + return os.path.abspath(os.path.join( + FileSystemService.root_path(), + FileSystemService.id_string_to_relative_path(name) + )) @staticmethod def full_path_from_relative_path(relative_path: str) -> str: diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py index 0ad302548..25912f5e7 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_service.py @@ -207,7 +207,10 @@ class ProcessModelService(FileSystemService): """Look for a given process_group, and return it.""" if os.path.exists(FileSystemService.root_path()): process_group_path = os.path.abspath( - os.path.join(FileSystemService.root_path(), process_group_id) + os.path.join( + FileSystemService.root_path(), + FileSystemService.id_string_to_relative_path(process_group_id) + ) ) if self.is_group(process_group_path): return self.__scan_process_group(process_group_path) diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py index c606ef6e9..31477acf8 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py @@ -2384,7 +2384,7 @@ class TestProcessApi(BaseTest): for group in groups: persisted = ProcessModelService().get_process_group(group) assert persisted is not None - assert persisted.id_for_file_path() == group + assert persisted.id == group def test_move_model( self,