Browse Source

Merge pull request #232 from sharoonthomas/master

Fixes Issue #227 where pop causes the session to be modified.
pull/238/head
Armin Ronacher 14 years ago
parent
commit
f2f806285d
  1. 3
      flask/helpers.py

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

Loading…
Cancel
Save