{% if messages %}
{% for message in messages %}
 {% if message.tags == 'error' %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
{{message}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
 </button>
  </div>
{% endif %}
{% endfor %}
{% endif %}
   {% if messages %}
{% for message in messages %}
 {% if message.tags == 'success' %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
{{message}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
 </button>
  </div>
{% endif %}
{% endfor %}
{% endif %}

{% if messages %}
  {% for message in messages %}
    {% if message.tags == 'warning' %}
      <div class="alert alert-warning alert-dismissible fade show" role="alert">
        {{ message }}
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
    {% endif %}
  {% endfor %}
{% endif %}