Retrieve a list of messages from the messages cookie. If the not_finished sentinel value is found at the end of the message list, remove it and return a result indicating that not all messages were retrieved by this storage.
(self, *args, **kwargs)
| 92 | self.signer = signing.get_cookie_signer(salt=self.key_salt) |
| 93 | |
| 94 | def _get(self, *args, **kwargs): |
| 95 | """ |
| 96 | Retrieve a list of messages from the messages cookie. If the |
| 97 | not_finished sentinel value is found at the end of the message list, |
| 98 | remove it and return a result indicating that not all messages were |
| 99 | retrieved by this storage. |
| 100 | """ |
| 101 | data = self.request.COOKIES.get(self.cookie_name) |
| 102 | messages = self._decode(data) |
| 103 | all_retrieved = not (messages and messages[-1] == self.not_finished) |
| 104 | if messages and not all_retrieved: |
| 105 | # remove the sentinel value |
| 106 | messages.pop() |
| 107 | return messages, all_retrieved |
| 108 | |
| 109 | def _update_cookie(self, encoded_data, response): |
| 110 | """ |