Skip to content

Commit

Permalink
'root_value_for_template' can handle 'StringTemplate' object
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Mar 19, 2024
1 parent 945f395 commit eaf580b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/ayon_core/pipeline/anatomy/anatomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import ayon_api

from ayon_core.lib import Logger, get_local_site_id
from ayon_core.lib import Logger, get_local_site_id, StringTemplate
from ayon_core.addon import AddonsManager

from .exceptions import RootCombinationError, ProjectNotSet
Expand Down Expand Up @@ -204,6 +204,8 @@ def _root_keys_from_templates(self, data):

def root_value_for_template(self, template):
"""Returns value of root key from template."""
if isinstance(template, StringTemplate):
template = template.template
root_templates = []
for group in re.findall(self.root_key_regex, template):
root_templates.append("{" + group + "}")
Expand Down

0 comments on commit eaf580b

Please sign in to comment.