Skip to content
Myr

Prevent pop if flashes not in session to avoid modification to session fixes #227

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sharoon Thomas · committed by Sharoon Thomas · parent 8b974eb · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:flask/helpers.py+2 added-1 removed
247 unmodified lines
248 :param with_categories: set to `True` to also receive categories.249 """250 flashes = _request_ctx_stack.top.flashes251 if flashes is None:252 _request_ctx_stack.top.flashes = flashes = session.pop('_flashes', [])252 _request_ctx_stack.top.flashes = flashes = session.pop('_flashes') \253 if '_flashes' in session else []254 if not with_categories:255 return [x[1] for x in flashes]256 return flashes257
260 unmodified lines