georgemarshall / django-cryptography

Easily encrypt data in Django
https://django-cryptography.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
371 stars 70 forks source link

Django 3.2 incompatible #57

Closed iurisilvio closed 2 years ago

iurisilvio commented 3 years ago

Django 3.2 implemented signer.sign_object, that fails with django-cryptography TimestampSigner.

To reproduce, call messages.error(request, 'foo') in a request.

Traceback (most recent call last):
  File "django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "django/utils/deprecation.py", line 119, in __call__
    response = self.process_response(request, response)
  File "django/contrib/messages/middleware.py", line 23, in process_response
    unstored_messages = request._messages.update(response)
  File "django/contrib/messages/storage/base.py", line 128, in update
    return self._store(messages, response)
  File "django/contrib/messages/storage/fallback.py", line 48, in _store
    messages = storage._store(messages, response, remove_oldest=False)
  File "django/contrib/messages/storage/cookie.py", line 124, in _store
    encoded_data = self._encode(messages)
  File "django/contrib/messages/storage/cookie.py", line 165, in _encode
    return self.signer.sign_object(messages, serializer=MessageSerializer, compress=True)
AttributeError: 'TimestampSigner' object has no attribute 'sign_object'
iurisilvio commented 3 years ago

I created the #58 PR fixing that and other Django 3.2 issues.

georgemarshall commented 2 years ago

Fixed in #68