{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {# aria-live on the wrapper, not role="alert" on each message. On a full page load the messages are already in the DOM when the region is created, so role="alert" announced nothing; a live region on a container that is present from the start announces what lands in it, which is what an Unpoly fragment swap does. `assertive` only for errors — a success confirmation should not interrupt what the reader is doing. #}