#28169: Unable to disconnect signal
-------------------------------------+-------------------------------------
               Reporter:  James      |          Owner:  nobody
  Addison                            |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I am looking to disconnect the `post_init` signal in a management command
 due to exceptions it raises in my scenario.  My disconnect looks like
 this:

 {{{#!python
 signals.post_init.disconnect(ImageField.update_dimension_fields,
 sender=Bug)
 }}}

 If I'm doing something wrong, I'd love to know what.

 Digging in a bit, it's caused by the fact that the lookup key generated in
 the `.connect()` at
 
https://github.com/django/django/blob/stable/1.11.x/django/dispatch/dispatcher.py#L105
 differs from the one generated in `.disconnect()` at
 
https://github.com/django/django/blob/stable/1.11.x/django/dispatch/dispatcher.py#L153

 Maybe related to #22657.  See the attached project to reproduce.

--
Ticket URL: <https://code.djangoproject.com/ticket/28169>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.159552d530cf982fbfb36e5253103502%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to