# HG changeset patch # User Marcin Kuzminski # Date 2017-07-12 16:53:19 # Node ID 741dca9b27244945a956391897dc5aae6a13776d # Parent 1a7936c38827a3a11f9204201e0dca902aad0607 pyramid: make flash messages not rely strictly on pylons session. - now if we pass in request it relies to bound session store of given request. diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -660,14 +660,17 @@ class _Message(object): class Flash(_Flash): - def pop_messages(self): + def pop_messages(self, request=None): """Return all accumulated messages and delete them from the session. The return value is a list of ``Message`` objects. """ - from pylons import session + messages = [] - messages = [] + if request: + session = request.session + else: + from pylons import session # Pop the 'old' pylons flash messages. They are tuples of the form # (category, message)