mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
[1.6.x] Fixed #22998 -- Updated the fast_delete logic for GFKs
Backport of 6e2b82fdf6 from master
This commit is contained in:
committed by
Anssi Kääriäinen
parent
609153d2bf
commit
227a0f27a6
@@ -136,9 +136,9 @@ class Collector(object):
|
||||
include_hidden=True, include_proxy_eq=True):
|
||||
if related.field.rel.on_delete is not DO_NOTHING:
|
||||
return False
|
||||
# GFK deletes
|
||||
for relation in opts.many_to_many:
|
||||
if not relation.rel.through:
|
||||
for field in model._meta.virtual_fields:
|
||||
if hasattr(field, 'bulk_related_objects'):
|
||||
# It's something like generic foreign key.
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user