From faa6546a8e254c71aec269abf5ca044db8703340 Mon Sep 17 00:00:00 2001 From: aykin Date: Wed, 15 Apr 2015 10:27:16 +0300 Subject: [PATCH 1/2] Update the_controller.rst The sample code does not work due to an array o string conversion exception. The documentation needs to be updated to reflect the change --- quick_tour/the_controller.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index bc90f0af99b..b555c56e68d 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -326,7 +326,7 @@ And you can display the flash message in the template like this: .. code-block:: html+jinja
- {{ app.session.flashbag.get('notice') }} + {{ app.session.flashbag.get('notice')[0] }}
Final Thoughts From f01b91682f570429aae86654114bc6ab9658fdc1 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 23 Jun 2015 17:42:59 +0200 Subject: [PATCH 2/2] Improved the code used to display flash notices --- quick_tour/the_controller.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index b555c56e68d..0904865a7f9 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -325,9 +325,11 @@ And you can display the flash message in the template like this: .. code-block:: html+jinja -
- {{ app.session.flashbag.get('notice')[0] }} -
+ {% for flashMessage in app.session.flashbag.get('notice') %} +
+ {{ flashMessage }} +
+ {% endfor %} Final Thoughts --------------