This reverts commit 32c1220c31.
This commit is contained in:
parent
531efc893f
commit
47fd3386fd
1 changed files with 3 additions and 7 deletions
|
|
@ -52,12 +52,6 @@ def _get_jenv():
|
|||
|
||||
return super().is_safe_attribute(obj, attr, *args, **kwargs)
|
||||
|
||||
def get_template(self, *args, **kwargs):
|
||||
# Note: jenv globals are reapplied here because we don't have true "global"/"local" separation.
|
||||
# Ideally globals should never change as per Jinja design.
|
||||
kwargs.update({"globals": self.globals})
|
||||
return super().get_template(*args, **kwargs)
|
||||
|
||||
# frappe will be loaded last, so app templates will get precedence
|
||||
jenv = FrappeSandboxedEnvironment(loader=get_jloader(), undefined=DebugUndefined, cache_size=32)
|
||||
set_filters(jenv)
|
||||
|
|
@ -67,7 +61,9 @@ def _get_jenv():
|
|||
|
||||
def get_template(path):
|
||||
jenv = get_jenv()
|
||||
return jenv.get_template(path)
|
||||
# Note: jenv globals are reapplied here because we don't have true "global"/"local" separation.
|
||||
# Ideally globals should never change as per Jinja design.
|
||||
return jenv.get_template(path, globals=jenv.globals)
|
||||
|
||||
|
||||
def get_email_from_template(name, args):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue