diff --git a/InvenTree/part/helpers.py b/InvenTree/part/helpers.py index b11ac9169d..a237a42843 100644 --- a/InvenTree/part/helpers.py +++ b/InvenTree/part/helpers.py @@ -5,7 +5,7 @@ import os from django.conf import settings -from jinja2 import Environment +from jinja2 import Environment, select_autoescape logger = logging.getLogger('inventree') @@ -32,10 +32,8 @@ def compile_full_name_template(*args, **kwargs): if template_string == _part_full_name_template_string and _part_full_name_template is not None: return _part_full_name_template - _part_full_name_template_string = template_string - env = Environment( - autoescape=True, + autoescape=select_autoescape(default_for_string=False, default=False), variable_start_string='{{', variable_end_string='}}' )