MCPcopy
hub / github.com/django/django / _get

Method _get

django/contrib/messages/storage/cookie.py:94–107  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 3

_decodeMethod · 0.95
getMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected