Closed esquonk closed 5 years ago
I get the following error when I put django_sorcery.db.middleware.SQLAlchemyMiddleware
at the top of MIDDLEWARE
list.
Traceback (most recent call last):
File "C:\Program Files\Python37\lib\wsgiref\handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "C:\Users\mi\proj\venv\flights\lib\site-packages\django\contrib\staticfiles\handlers.py", line 65, in __call__
return self.application(environ, start_response)
File "C:\Users\mi\proj\venv\flights\lib\site-packages\django\core\handlers\wsgi.py", line 141, in __call__
response = self.get_response(request)
File "C:\Users\mi\proj\venv\flights\lib\site-packages\django\core\handlers\base.py", line 76, in get_response
response._closable_objects.append(request)
AttributeError: 'NoneType' object has no attribute '_closable_objects'
You're correct, it should return response there
Please try the fix. You can install it with pip install https://github.com/shosca/django-sorcery/archive/middleware.zip
Thanks for the quick fix!
SQLAlchemyMiddleware
does not return response object and breaks middleware chainThis commit appears to cause the issue.
Am I missing something here?