From 5999511460cf3fdbb2bce04294f1de0089902809 Mon Sep 17 00:00:00 2001 From: Max Norba Date: Fri, 11 Jun 2021 10:41:51 +0300 Subject: [PATCH] Fix the issue with Jinja v.3 related to absent of JINJA_EXTENSIONS variable --- templates/base.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/base.html b/templates/base.html index 0da863e..bfed206 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,7 +1,9 @@ -{% if 'jinja2.ext.i18n' not in JINJA_ENVIRONMENT.extensions and 'jinja2.ext.i18n' not in JINJA_EXTENSIONS %} - {%- macro _(msg) -%} - {{ msg % kwargs }} - {%- endmacro -%} +{% if 'jinja2.ext.i18n' not in JINJA_ENVIRONMENT.extensions %} + {% if JINJA_EXTENSIONS is not defined or 'jinja2.ext.i18n' not in JINJA_EXTENSIONS %} + {%- macro _(msg) -%} + {{ msg % kwargs }} + {%- endmacro -%} + {% endif %} {% endif %}