{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for cat, msg in messages %} {% if cat=="success" %}
  {{ msg }}
{% endif %} {% if cat=="error" %}
  {{ msg }}
{% endif %} {% endfor %} {% endif %} {% endwith %} {% block content %} {% endblock %}