base: Fix jinja2.exceptions.UndefinedError on Python ≥ 3.7.

Python 3.7 changed dict.update to avoid swallowing exceptions when
checking for the keys attribute (https://bugs.python.org/issue31572).
This broke {}.update(jinja2.Undefined()).

Fix it with an explicit default.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-04-18 05:12:53 -07:00
parent 87ba6cb4c9
commit d33abba687
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@
{% endblock %}
{% set all_page_params = default_page_params.copy() %}
{% set _ = all_page_params.update(page_params) %}
{% set _ = all_page_params.update(page_params|default({})) %}
<div hidden id="page-params" data-params='{{ all_page_params|tojson }}'></div>
</body>