From cd1bf6d302e2f369b2a3cca0a21b64a85c8d9a79 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 29 Jun 2021 14:10:23 +0200 Subject: [PATCH] added better condition for full replacements --- openpype/settings/entities/lib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openpype/settings/entities/lib.py b/openpype/settings/entities/lib.py index cf0da29978..92510e04d5 100644 --- a/openpype/settings/entities/lib.py +++ b/openpype/settings/entities/lib.py @@ -129,6 +129,7 @@ def _fill_schema_template_data( elif isinstance(template, STRING_TYPE): # TODO find much better way how to handle filling template data template = template.replace("{{", "__dbcb__").replace("}}", "__decb__") + full_replacement = False for replacement_string in template_key_pattern.findall(template): key = str(replacement_string[1:-1]) required_keys.add(key) @@ -141,11 +142,12 @@ def _fill_schema_template_data( # Replace the value with value from templates data # - with this is possible to set value with different type template = value + full_replacement = True else: # Only replace the key in string template = template.replace(replacement_string, value) - if isinstance(template, STRING_TYPE): + if not full_replacement: output = template.replace("__dbcb__", "{").replace("__decb__", "}") else: output = template