﻿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
26642	ModelSignal.disconnect() does not work with lazy references	Alex Hill	nobody	"`ModelSignal.connect()` lets you pass a string model reference as a sender, and will connect the signal as soon as the model is available.

For consistency, `ModelSignal.disconnect()` should work in the same way. Currently, if you call `connect()` followed by `disconnect()` before the model is available, the signal will remain connected:

{{{#!python

>>> def receiver(sender, **kwargs):
...     print(""post_init sent by %r"" % sender)
... 
>>> post_init.connect(receiver, sender='some_app.SomeModel')
>>> post_init.disconnect(receiver, sender='some_app.SomeModel')
False
>>> 
>>> class SomeModel(models.Model):
...     class Meta:
...         app_label = 'some_app'
... 
>>> s = SomeModel()
post_init sent by <class 'SomeModel'>
>>> 
}}}

There's a patch with the necessary changes in PR 6629."	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed			Accepted	1	0	0	0	0	0
