mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #22998 -- Updated the fast_delete logic for GFKs
This commit is contained in:
committed by
Anssi Kääriäinen
parent
28efafa24c
commit
6e2b82fdf6
@@ -138,9 +138,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