#13534: m2m_changed signal doesn't call receiver
----------------------------------------------+-----------------------------
 Reporter:  Chris Targett <ch...@xlevus.net>  |       Owner:  nobody    
   Status:  new                               |   Milestone:  1.2       
Component:  Database layer (models, ORM)      |     Version:  1.2-beta  
 Keywords:  m2m_save, dispatch, signal        |       Stage:  Unreviewed
Has_patch:  0                                 |  
----------------------------------------------+-----------------------------
 For some reason or another the m2m_changed signal does not call the
 receiver.

 A rough models.py similar to my code:
 {{{
 #!python

 class SomeContent(models.Model):
   sites = models.ForeignKey(Site)

 def m2m_handler(sender, instance, action, reverse, model, pk_set,
 **kwargs):
   raise NotImplementedError
 models.signals.m2m_changed.connect(m2m_handler, SomeContent)


 >>> sc = SomeContent()
 >>> sc.save()
 >>> sc.sites.add(Site.objects.get_current()) # Here you would expect a
 "NotImplementedError"
 >>>
 }}}

 It seems the signal loses all receivers in
 `django.dispatch.dispatcher.Signal._line_receivers` line 215.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13534>
Django <http://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 post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to