mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Work around incompatibilty between govuk-frontend-jinja and Flask 2
This line:
ddbe208a97/govuk_frontend_jinja/flask_ext.py (L22)
Raises `KeyError: 'extensions'` when using Flask 2
I think this is because there are no default Jinja extensions in Flask
as of pallets/flask@81ba6c2 in accordance with
https://github.com/pallets/jinja/issues/1203
So we need to manually add an `extensions` field to the `jinja_options`
`dict` if one doesn’t exist already.
Issue raised here: https://www.github.com/Crown-Commercial-Service/govuk-frontend-jinja/issues/66
This commit is contained in:
@@ -162,6 +162,9 @@ def create_app(application):
|
||||
|
||||
init_app(application)
|
||||
|
||||
if 'extensions' not in application.jinja_options:
|
||||
application.jinja_options['extensions'] = []
|
||||
|
||||
init_govuk_frontend(application)
|
||||
init_jinja(application)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user