DisplayMessageBeforeRedirectMiddleware cannot reset the storage.used flag
Message storages do not work correctly if the used flag is reset to False. Instead of doing that we should only consume messages if necessary.
middleware: iterate message storage only if messages are consumed (fixes #9191)
If a message storage has been iterated but the used flag is reset to False,
semi-consumed messages are pushed to the cookie without normalization by
_prepare_message, as some of them are lazy strings, it breaks the JSON encoder.
The message storage must be iterated only if we are sure messages are going be
#1 Updated by Benjamin Dauvergne over 3 years ago
- % Done changed from 0 to 100
- Status changed from Nouveau to Résolu (à déployer)
Appliqué par commit authentic2|33d3c7195e2c4b3020a1bd5511ae0ec43227c208.