GenericRelation cascade deletion doesn't fire pre_delete signals
|Reported by:||gwahl@…||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:1 Changed 17 months ago by gwahl@…
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 17 months ago by timo
- Component changed from Uncategorized to Database layer (models, ORM)
- Severity changed from Normal to Release blocker
- Triage Stage changed from Unreviewed to Accepted
comment:5 Changed 17 months ago by Anssi Kääriäinen <akaariai@…>
- Resolution set to fixed
- Status changed from new to closed