Skip to content

Commit

Permalink
5.0: Update django.contrib.messages.storage (#2106)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeHyuckSa authored May 1, 2024
1 parent 43df358 commit 38285f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 14 additions & 1 deletion django-stubs/contrib/messages/storage/cookie.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import Any
from typing import Any, Callable, Sequence

from django.contrib.messages.storage.base import BaseStorage

Expand All @@ -14,7 +14,20 @@ class MessageEncoder(json.JSONEncoder):
class MessageDecoder(json.JSONDecoder):
def process_messages(self, obj: Any) -> Any: ...

class MessagePartSerializer:
def dumps(self, obj: Any) -> Sequence[str]: ...

class MessagePartGatherSerializer:
def dumps(self, obj: Any) -> bytes: ...

class MessageSerializer:
def loads(self, data: bytes | bytearray) -> Any: ...

class CookieStorage(BaseStorage):
cookie_name: str
max_cookie_size: int
not_finished: str
not_finished_json: str

def bisect_keep_left(a: list[int], fn: Callable[[list[int]], bool]) -> int: ...
def bisect_keep_right(a: list[int], fn: Callable[[list[int]], bool]) -> int: ...
1 change: 0 additions & 1 deletion scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ django.contrib.humanize.templatetags.humanize.intword_converters
django.contrib.messages.storage.cookie.CookieStorage.key_salt
django.contrib.messages.storage.cookie.MessageDecoder.decode
django.contrib.messages.storage.cookie.MessageEncoder.default
django.contrib.messages.storage.cookie.MessageSerializer
django.contrib.postgres.fields.ArrayField.formfield
django.contrib.postgres.fields.CIText.__init__
django.contrib.postgres.fields.HStoreField.formfield
Expand Down
5 changes: 0 additions & 5 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ django.contrib.gis.management
django.contrib.gis.management.commands
django.contrib.gis.management.commands.inspectdb
django.contrib.gis.management.commands.ogrinspect
django.contrib.messages.storage.cookie.CookieStorage.not_finished_json
django.contrib.messages.storage.cookie.MessagePartGatherSerializer
django.contrib.messages.storage.cookie.MessagePartSerializer
django.contrib.messages.storage.cookie.bisect_keep_left
django.contrib.messages.storage.cookie.bisect_keep_right
django.contrib.messages.test
django.db.backends.base.features.BaseDatabaseFeatures.delete_can_self_reference_subquery
django.db.backends.base.features.BaseDatabaseFeatures.insert_test_table_with_defaults
Expand Down

0 comments on commit 38285f1

Please sign in to comment.