Skip to content

Instantly share code, notes, and snippets.

@vmagamedov
Created December 25, 2014 06:15
Show Gist options
  • Save vmagamedov/9207bc496ddbe6bbade0 to your computer and use it in GitHub Desktop.
Save vmagamedov/9207bc496ddbe6bbade0 to your computer and use it in GitHub Desktop.
class Env(jinja2.sandbox.SandboxedEnvironment):
def is_safe_attribute(self, obj, attr, value):
if isinstance(obj, basestring) and attr == 'format':
return False
return super(Env, self).is_safe_attribute(obj, attr, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment