chibisov / drf-extensions

DRF-extensions is a collection of custom extensions for Django REST Framework
http://chibisov.github.io/drf-extensions/docs
MIT License
1.48k stars 208 forks source link

django 3.2 compatibility : do not use _headers #307

Closed artragis closed 3 years ago

artragis commented 3 years ago

fix #306

This PR removes the use of _headers when we are on django 3.2 and onwards but keeps it for 3.0 and 3.1. the .items method was introduced in django 3.0 and _headers attribute was removed in 3.2.

auvipy commented 3 years ago

all the tests are failing

artragis commented 3 years ago

Yes I'm trying to see why the .values has changed organization and how to fix the issue.

Bensas commented 3 years ago

Shouldn't the headers.values() call in line 103 of rest_framework_extensions/cache/decorators.py be changed to headers.items()? values() doesn't return a key/value pair as far as I know.

auvipy commented 3 years ago

you can try and test

artragis commented 3 years ago

doesn't return a key/value pair as far as I know.

main issue is that this call is the current code. I will try to use items() tomorrow but it's quite surprising the code is working now with values().

artragis commented 3 years ago

Ok, I found a fix. The internal structure of header dictionary has deeply changed.

IrinaAlexandra commented 3 years ago

any idea when to expect a new release with this fix? xD

syphar commented 3 years ago

We would also love to have this released.

What can we do to help? Testing this in our env? Something else?

auvipy commented 3 years ago

donating some money for my time is the most that needed