Browse files

Fixed assumption made on session implementations.

In the snippet 'session.setdefault(...).append(...)', it was being
assumed that changes made to mutable structures in the session are
are always in sync with the session object, which is not true for
session implementations that use a external storage for keeping their
  • Loading branch information...
tarruda committed Mar 2, 2012
1 parent 8d7ca29 commit 8445f0d939dc3c4a2e722dc6dd4938d02bc2e094
Showing with 3 additions and 1 deletion.
  1. +3 −1 flask/
@@ -261,7 +261,9 @@ def flash(message, category='message'):
messages and ``'warning'`` for warnings. However any
kind of string can be used as category.
- session.setdefault('_flashes', []).append((category, message))
+ flashes = session.get('_flashes', [])
+ flashes.append((category, message))
+ session['_flashes'] = flashes
def get_flashed_messages(with_categories=False, category_filter=[]):

0 comments on commit 8445f0d

Please sign in to comment.