Fix a Jinja2 migration regression; #1824