{% with msgs = get_flashed_messages() %}
{% if msgs %}
{% for m in msgs %}
{% with mtype = (m|string).startswith %}
{% with prefix = (m|string).removeprefix %}
{% if mtype('F:') %}
Неверно заполнены: {{ prefix('F:') }}
{% elif mtype('E:') %}
{{ prefix('E:') }}
{% elif mtype('W:') %}
{{ prefix('W:') }}
{% elif mtype('I:') %}
{{ prefix('I:') }}
{% endif %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endif %}
{% endwith %}