makinacorpus / django-safedelete

Mask your objects instead of deleting them from your database.
https://django-safedelete.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
677 stars 122 forks source link

[CRITICAL] Django UpdateQuery doesn't apply SafeDelete filter #242

Open iamhssingh opened 1 month ago

iamhssingh commented 1 month ago

Problem Statement

When running Model.objects.update(), safe delete filter is not applied.

Reason

In case of .update (Ref: Django repo), the SafeDelete query class is replaced by UpdateQuery during query chain.

Exact line which replaces the class

So when get_compiler is called, SafeDeleteQuery.get_compiler is not called. (Introduced in #160 )