Skip to content

Commit

Permalink
Attempt to fix running with jinja 3.1
Browse files Browse the repository at this point in the history
Apparently this was only properly tested with 3.0 :/
  • Loading branch information
mhagander committed Dec 13, 2024
1 parent f1f9a37 commit f3695b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion postgresqleu/confreg/jinjafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,13 @@ def render_jinja_conference_template(conference, templatename, dictionary, disab
if conference and conference.jinjaenabled and conference.jinjadir and not os.path.exists(os.path.join(conference.jinjadir, 'templates/base.html')):
raise Http404()

if jinja2.__version__ > '3.1':
extensions = []
else:
extensions = ['jinja2.ext.with_']
env = ConfSandbox(
loader=ConfTemplateLoader(conference, templatename, disableconferencetemplates=disableconferencetemplates),
extensions=['jinja2.ext.with_'],
extensions=extensions,
)
env.filters.update(extra_filters)
env.globals.update(extra_globals)
Expand Down

0 comments on commit f3695b6

Please sign in to comment.