﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31454	The behavior of m2m_changed signals does not match the documentation.	Konstantin Yegupov	nobody	"Found in v2.2.11, still appears to be valid for the master version.

The documentation at https://docs.djangoproject.com/en/3.0/ref/signals/ says:

""pre_add""
Sent before one or more objects are added to the relation.

But, in fact, pre_add is sent even if *zero* objects are added to the relation (because all the objects to be added already exist in the database).
The pk_set argument will be empty, but the signal will still fire.
The same applies to post_add, pre_remove, post_remove ""actions"".

Either the documentation needs to be corrected to explain that pk_set might be empty, or the code in related_descriptors.py should not fire the signals when missing_target_ids / old_ids is empty.

See also: https://code.djangoproject.com/ticket/29615"	Cleanup/optimization	closed	Documentation	3.0	Normal	duplicate	signal, m2m_changed		Unreviewed	0	0	0	0	0	0
