Simple replace wrapper template variables instead of python formatting to allow use braces

This commit is contained in:
shortcutme 2018-03-06 12:00:30 +01:00
parent b0a8c4d278
commit 3e970df09b
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -245,8 +245,10 @@ class UiRequest(object):
# Renders a template # Renders a template
def render(self, template_path, *args, **kwargs): def render(self, template_path, *args, **kwargs):
template = open(template_path).read().decode("utf8") template = open(template_path).read()
return template.format(**kwargs).encode("utf8") for key, val in kwargs.items():
template = template.replace("{%s}" % key, "%s" % val)
return template
# - Actions - # - Actions -