From 737fa72ae3de1debe97f0a527eeebda3869aa227 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 16 Sep 2021 09:45:43 +0200 Subject: Refs #32191 -- Removed for the pre-Django 3.2 format of messages in CookieStorage. Per deprecation timeline. --- django/contrib/messages/storage/cookie.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'django') diff --git a/django/contrib/messages/storage/cookie.py b/django/contrib/messages/storage/cookie.py index 81c436fa04..1d390c71dd 100644 --- a/django/contrib/messages/storage/cookie.py +++ b/django/contrib/messages/storage/cookie.py @@ -161,21 +161,8 @@ class CookieStorage(BaseStorage): return None try: return self.signer.unsign_object(data, serializer=MessageSerializer) - # RemovedInDjango41Warning: when the deprecation ends, replace with: - # - # except (signing.BadSignature, json.JSONDecodeError): - # pass - except signing.BadSignature: - decoded = None - except (binascii.Error, json.JSONDecodeError): - decoded = self.signer.unsign(data) - - if decoded: - # RemovedInDjango41Warning. - try: - return json.loads(decoded, cls=MessageDecoder) - except json.JSONDecodeError: - pass + except (signing.BadSignature, binascii.Error, json.JSONDecodeError): + pass # Mark the data as used (so it gets removed) since something was wrong # with the data. self.used = True -- cgit v1.3