{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning messages">
  <a href="#" class="close" data-dismiss="alert">&times;</a>
  {{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
