added ability to pass curly brackets in templates as labels

This commit is contained in:
iLLiCiTiT 2021-05-28 18:54:18 +02:00
parent 6d1bbb6a12
commit 467a3969cb

View file

@ -114,6 +114,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__")
for replacement_string in template_key_pattern.findall(template):
key = str(replacement_string[1:-1])
required_keys.add(key)
@ -129,7 +130,8 @@ def _fill_schema_template_data(
else:
# Only replace the key in string
template = template.replace(replacement_string, value)
output = template
output = template.replace("__dbcb__", "{").replace("__decb__", "}")
else:
output = template