Skip to content

Commit

Permalink
Merge pull request #1021 from ynput/enhancement/dont-require-hierarchy
Browse files Browse the repository at this point in the history
Editorial: Don't require 'hierarchy' key on instance
  • Loading branch information
iLLiCiTiT authored Nov 25, 2024
2 parents 333363f + b1df99d commit 923355c
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,14 +413,16 @@ def _fill_folder_data(self, instance, project_entity, anatomy_data):
# Backwards compatible (Deprecated since 24/06/06)
or instance.data.get("newAssetPublishing")
):
hierarchy = instance.data["hierarchy"]
anatomy_data["hierarchy"] = hierarchy
folder_path = instance.data["folderPath"]
parents = folder_path.lstrip("/").split("/")
folder_name = parents.pop(-1)

parent_name = project_entity["name"]
if hierarchy:
parent_name = hierarchy.split("/")[-1]
hierarchy = ""
if parents:
parent_name = parents[-1]
hierarchy = "/".join(parents)

folder_name = instance.data["folderPath"].split("/")[-1]
anatomy_data.update({
"asset": folder_name,
"hierarchy": hierarchy,
Expand Down

0 comments on commit 923355c

Please sign in to comment.