Refs #18676 -- Enabled fast-delete for m2m_changed senders.
There's no reason to disable fast-delete when an intermediary
many-to-many model has connected m2m_changed receivers because the
signal is only sent when related manager's clear() and remove() methods
are directly called.
This must have been overlooked in 1cd6e04cd4
given no regression tests fail when m2m_changed is not taken into
consideration to determine if fast-delete can be enabled.
This commit is contained in:
parent
8180ffba21
commit
26c4be2ebe
|
@ -136,8 +136,7 @@ class Collector:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
if (signals.pre_delete.has_listeners(model) or
|
if (signals.pre_delete.has_listeners(model) or
|
||||||
signals.post_delete.has_listeners(model) or
|
signals.post_delete.has_listeners(model)):
|
||||||
signals.m2m_changed.has_listeners(model)):
|
|
||||||
return False
|
return False
|
||||||
# The use of from_field comes from the need to avoid cascade back to
|
# The use of from_field comes from the need to avoid cascade back to
|
||||||
# parent when parent delete is cascading to child.
|
# parent when parent delete is cascading to child.
|
||||||
|
|
Loading…
Reference in New Issue