Skip to content

Commit

Permalink
Merge pull request #841 from ynput/feature/AY-5185_render-product-tem…
Browse files Browse the repository at this point in the history
…plates

Use product name for render templates
  • Loading branch information
antirotor authored Aug 21, 2024
2 parents be1552a + 9929b8a commit eaf05a0
Show file tree
Hide file tree
Showing 7 changed files with 264 additions and 102 deletions.
8 changes: 5 additions & 3 deletions client/ayon_core/pipeline/create/product_name.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ayon_api

from ayon_core.lib import StringTemplate, filter_profiles, prepare_template_data
from ayon_core.settings import get_project_settings
from ayon_core.lib import filter_profiles, prepare_template_data

from .constants import DEFAULT_PRODUCT_TEMPLATE

Expand Down Expand Up @@ -183,7 +182,10 @@ def get_product_name(
fill_pairs[key] = value

try:
return template.format(**prepare_template_data(fill_pairs))
return StringTemplate.format_strict_template(
template=template,
data=prepare_template_data(fill_pairs)
)
except KeyError as exp:
raise TemplateFillError(
"Value for {} key is missing in template '{}'."
Expand Down
Loading

0 comments on commit eaf05a0

Please sign in to comment.