{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="row">
    <div class="col-lg-12">
        {% for category, message in messages %}
        <div class="alert alert-{{ category }} alert-dismissible fade in">
            <button aria-label="Close" data-dismiss="alert" class="close" type="button"><span
                    aria-hidden="true">×</span></button>
            <p>{{ message }}</p>
        </div>
        {% endfor %}
    </div>
</div>
{% endif %}
{% endwith %}