diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-16 09:45:43 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-20 21:23:01 +0200 |
| commit | 737fa72ae3de1debe97f0a527eeebda3869aa227 (patch) | |
| tree | c76da48abdf0f9fadd1a075f8d350289d7e674dd /django | |
| parent | 05f3a6186efefc9fca2204a745b992501c6fd91f (diff) | |
Refs #32191 -- Removed for the pre-Django 3.2 format of messages in CookieStorage.
Per deprecation timeline.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/messages/storage/cookie.py | 17 |
1 files changed, 2 insertions, 15 deletions
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 |
