Skip to content
Browse files

Merge pull request #232 from sharoonthomas/master

Fixes Issue #227 where pop causes the session to be modified.
  • Loading branch information...
2 parents 7242abc + 57920a5 commit f2f806285de4505709c1f5a7811ad5c86dbe7580 @mitsuhiko mitsuhiko committed May 24, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 flask/helpers.py
View
3 flask/helpers.py
@@ -249,7 +249,8 @@ def get_flashed_messages(with_categories=False):
"""
flashes = _request_ctx_stack.top.flashes
if flashes is None:
- _request_ctx_stack.top.flashes = flashes = session.pop('_flashes', [])
+ _request_ctx_stack.top.flashes = flashes = session.pop('_flashes') \
+ if '_flashes' in session else []
if not with_categories:
return [x[1] for x in flashes]
return flashes

0 comments on commit f2f8062

Please sign in to comment.
Something went wrong with that request. Please try again.