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): messages = get_and_delete_messages(self.request) return messages