From: Magnus Hagander Date: Tue, 16 Oct 2018 08:51:52 +0000 (+0200) Subject: Apply dictionary update in the right place for jinja templates X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=f92f6c4287809e013897664880b9b71c4c5fa394;p=pgeu-website.git Apply dictionary update in the right place for jinja templates If we want the context.override.json file to actually override, we have to load it last, not first. --- diff --git a/postgresqleu/confreg/jinjafunc.py b/postgresqleu/confreg/jinjafunc.py index b14bc17..a743b5c 100644 --- a/postgresqleu/confreg/jinjafunc.py +++ b/postgresqleu/confreg/jinjafunc.py @@ -254,6 +254,9 @@ def render_jinja_conference_response(request, conference, pagemagic, templatenam c['githash'] = find_git_revision(conference.jinjadir) + if dictionary: + c.update(dictionary) + # For local testing, there may also be a context.override.json if conference and conference.jinjadir and os.path.exists(os.path.join(conference.jinjadir, 'templates/context.override.json')): try: @@ -262,8 +265,6 @@ def render_jinja_conference_response(request, conference, pagemagic, templatenam except Exception: pass - if dictionary: - c.update(dictionary) c.update(settings_context_unicode()) return HttpResponse(t.render(**c), content_type='text/html')