diff --git a/repologyapp/templates/_base.html b/repologyapp/templates/_base.html
index 3ff23549..0e28d0a8 100644
--- a/repologyapp/templates/_base.html
+++ b/repologyapp/templates/_base.html
@@ -71,7 +71,7 @@
{% endblock %}
-{% with flashed_messages = get_flashed_messages(with_categories=true) %}
+{% set flashed_messages = get_flashed_messages(with_categories=true) %}
{% if flashed_messages or messages %}
{% for category, message in flashed_messages %}
@@ -82,7 +82,6 @@
{% endfor %}
{% endif %}
-{% endwith %}
{% block content %}
{% endblock %}