From b0678c41052cf2947c2733af4a21e174cf453e8e Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Mon, 26 Aug 2024 08:16:29 +0200 Subject: [PATCH] Accept empty resource paths in linked objects when storing --- src/ansys/acp/core/_tree_objects/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ansys/acp/core/_tree_objects/base.py b/src/ansys/acp/core/_tree_objects/base.py index b006695556..42c7afac8e 100644 --- a/src/ansys/acp/core/_tree_objects/base.py +++ b/src/ansys/acp/core/_tree_objects/base.py @@ -306,6 +306,9 @@ def store(self: Self, parent: TreeObject) -> None: path_values = [collection_path.value] + [ path.value for _, _, path in linked_path_fields(self._pb_object.properties) ] + # filter out empty paths + path_values = [path for path in path_values if path] + # Since the path starts with 'model/', the objects belong to # the same model iff they share at least the first two parts. if len(to_parts(common_path(*path_values))) < 2: