Fix flask.messages render

This commit is contained in:
Santiago L 2022-04-05 11:27:21 +02:00
parent 88751b46bd
commit b465513212
1 changed files with 5 additions and 1 deletions

View File

@ -195,7 +195,11 @@
{% block messages %} {% block messages %}
{% for level, message in get_flashed_messages(with_categories=true) %} {% for level, message in get_flashed_messages(with_categories=true) %}
<div class="alert alert-{{ level}} alert-dismissible fade show" role="alert"> <div class="alert alert-{{ level}} alert-dismissible fade show" role="alert">
{% if '_message_icon' in session %}
<i class="bi bi-{{ session['_message_icon'][level]}} me-1"></i> <i class="bi bi-{{ session['_message_icon'][level]}} me-1"></i>
{% else %}<!-- fallback if 3rd party libraries (e.g. flask_login.login_required) -->
<i class="bi bi-info-circle me-1"></i>
{% endif %}
{{ message }} {{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div> </div>