Suor / django-cacheops

A slick ORM cache with automatic granular event-driven invalidation.
BSD 3-Clause "New" or "Revised" License
2.1k stars 227 forks source link

pre_save still fires query if CACHEOPS_ENABLED=False #388

Closed caffodian closed 3 years ago

caffodian commented 3 years ago

Just getting started with this library, so I might be missing something:

Should the _pre_save still be doing a get if cacheops is disabled? Seems like it will not be used in _post_save anyway. I'm just making sense of the code now and am not sure if this is intended.

This is causing some issues with us trying out the library, since a bunch of querycount related tests all get an extra query for every thing that is saved, even with caching disabled. Happy to PR something if this is in fact unintended.

Thanks!

Suor commented 3 years ago

Looks like a bug.