GenericRelation cascade deletion doesn't fire pre_delete signals
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.6|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have three models:
Node (gfk to)-> Content (fk to)-> Related
Deleting a Related cascades to delete the Content which cascades to delete the Node (because Content has a GenericRelation). This is the expected behavior. However, in Django 1.5 pre_delete would be trigger on Node before deleting it. In 1.6, this is no longer the case.
I've written a test case here: https://github.com/fusionbox/django/tree/generic_relation_cascade_signal. The test passes on 1.5 and fails on 1.6, 1.7, and master.
This may be related to #22594 -- both involve fast_delete incorrectly returning True.
Change History (8)
comment:2 Changed 3 years ago by
|Component:||Uncategorized → Database layer (models, ORM)|
|Severity:||Normal → Release blocker|
|Triage Stage:||Unreviewed → Accepted|