You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flash messages added programatically server side (using ckan.lib.helpers.flash_notice, etc.) are not displayed on the page.
The issue was caused by commit 4ec3ac0 which added a Jinja block block_inner within the section that displayed the flash messages in page.html. The block in question caused the variable flash_messages to become out of scope, and thus no flash messages are ever displayed.
The fix is simple: simply move the assignment of flash_messages within the block:
--- a/ckan/templates/page.html+++ b/ckan/templates/page.html@@ -21,9 +21,9 @@
<div id="content" class="container">
{% block main_content %}
{% block flash %}
- {% set flash_messages = h.flash.pop_messages() | list %}
<div class="flash-messages">
{% block flash_inner %}
+ {% set flash_messages = h.flash.pop_messages() | list %}
{% for message in flash_messages %}
<div class="alert fade in {{ message.category }}">
{{ h.literal(message) }}
The text was updated successfully, but these errors were encountered:
Flash messages added programatically server side (using ckan.lib.helpers.flash_notice, etc.) are not displayed on the page.
The issue was caused by commit 4ec3ac0 which added a Jinja block
block_inner
within the section that displayed the flash messages in page.html. The block in question caused the variableflash_messages
to become out of scope, and thus no flash messages are ever displayed.The fix is simple: simply move the assignment of flash_messages within the block:
The text was updated successfully, but these errors were encountered: