fix jinja2 regression

This fixes #1824.