MCPcopy
hub / github.com/django/django / _encode_parts

Method _encode_parts

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

Return an encoded version of the serialized messages list which can be stored as plain text. Since the data will be retrieved from the client-side, the encoded data also contains a hash to ensure that the data was not tampered with.

(self, messages, encode_empty=False)

Source from the content-addressed store, hash-verified

173 return unstored_messages
174
175 def _encode_parts(self, messages, encode_empty=False):
176 """
177 Return an encoded version of the serialized messages list which can be
178 stored as plain text.
179
180 Since the data will be retrieved from the client-side, the encoded data
181 also contains a hash to ensure that the data was not tampered with.
182 """
183 if messages or encode_empty:
184 return self.signer.sign_object(
185 messages, serializer=MessagePartGatherSerializer, compress=True
186 )
187
188 def _encode(self, messages, encode_empty=False):
189 """

Callers 3

_storeMethod · 0.95
compute_msgMethod · 0.95
_encodeMethod · 0.95

Calls 1

sign_objectMethod · 0.80

Tested by

no test coverage detected