def _get_messages(self): if hasattr(self, '_messages'): return self._messages self._messages = get_and_delete_messages(self.request) return self._messages
def get_and_delete(self): """returns messages sent to the anonymous user via session, and removes messages from the session""" messages = get_and_delete_messages(self.request) return messages