{% with messages = get_flashed_messages() %} {%- if messages -%}
{% for item in messages %} {% endfor %}
{%- endif -%} {% endwith %}