Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def render_template(self, template_name, directives=None, blocking=True, **kwargs):
if directives is None:
directives = set()
else:
directives = set(directives)
if blocking:
directives.add(Persistent)
elif Persistent in directives:
directives.remove(Persistent)
kwargs['directives'] = directives
template = self.env.get_template(template_name)
return template.render(**kwargs)
def render_template(self, template_name, directives=None, blocking=True, **kwargs):
if directives is None:
directives = set()
else:
directives = set(directives)
if blocking:
directives.add(Persistent)
elif Persistent in directives:
directives.remove(Persistent)
kwargs['directives'] = directives
template = self.env.get_template(template_name)
return template.render(**kwargs)