# HG changeset patch # User Rémi Cardona # Date 1383232357 -3600 # Node ID 3bdf85279c67dbeb6bb85ccc85af826a334e39f8 # Parent a3c075fe9385c196a5c63e6b87e0d4434302a9a0 [request] Make sure set_message() actually displays its given message (closes #3003425) The default automatic form sets a standard submit message as session data. However in some cases, such as the cancellation of a form edition, another message is intended to be printed on-screen. This patch makes sure that set_message() really scrubs all previous messages (and ids) from the request object and from the session data. diff -r a3c075fe9385 -r 3bdf85279c67 web/request.py --- a/web/request.py Tue Feb 18 13:54:08 2014 +0100 +++ b/web/request.py Thu Oct 31 16:12:37 2013 +0100 @@ -318,6 +318,7 @@ def set_message(self, msg): assert isinstance(msg, unicode) + self.reset_message() self._msg = msg def set_message_id(self, msgid): @@ -348,6 +349,7 @@ if hasattr(self, '_msg'): del self._msg if hasattr(self, '_msgid'): + self.session.data.pop(self._msgid, u'') del self._msgid def update_search_state(self):