Skip to content

Commit

Permalink
Merge pull request #417 from tarruda/master
Browse files Browse the repository at this point in the history
Fixed assumption made on session implementations
  • Loading branch information
rduplain committed Apr 1, 2012
2 parents 9ab41ed + 8445f0d commit 71a9766
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flask/helpers.py
Expand Up @@ -283,7 +283,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=[]):
Expand Down

0 comments on commit 71a9766

Please sign in to comment.