1
0
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:
Gavin Wahl
2014-07-14 10:42:14 -06:00
committed by Anssi Kääriäinen
parent 28efafa24c
commit 6e2b82fdf6
3 changed files with 41 additions and 4 deletions

View File

@@ -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