Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #10753 -- Fixed regression in dispatcher after [10398]. Thanks …

…for the patch and tests, minmax

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b366bcc962d6390ecaa462d73fca9004c9e7f44c 1 parent 9e9a2b8
Adrian Holovaty authored April 10, 2009
1  django/dispatch/dispatcher.py
@@ -124,6 +124,7 @@ def disconnect(self, receiver=None, sender=None, weak=True, dispatch_uid=None):
124 124
             (r_key, _) = self.receivers[index]
125 125
             if r_key == lookup_key:
126 126
                 del self.receivers[index]
  127
+                break
127 128
 
128 129
     def send(self, sender, **named):
129 130
         """Send signal from sender to all connected receivers.
13  tests/regressiontests/dispatch/tests/test_dispatcher.py
@@ -103,6 +103,19 @@ def fails(val, **kwargs):
103 103
         a_signal.disconnect(fails)
104 104
         self._testIsClean(a_signal)
105 105
 
  106
+    def testDisconnection(self):
  107
+        receiver_1 = Callable()
  108
+        receiver_2 = Callable()
  109
+        receiver_3 = Callable()
  110
+        a_signal.connect(receiver_1)
  111
+        a_signal.connect(receiver_2)
  112
+        a_signal.connect(receiver_3)
  113
+        a_signal.disconnect(receiver_1)
  114
+        del receiver_2
  115
+        garbage_collect()
  116
+        a_signal.disconnect(receiver_3)
  117
+        self._testIsClean(a_signal)
  118
+
106 119
 def getSuite():
107 120
     return unittest.makeSuite(DispatcherTests,'test')
108 121
 

0 notes on commit b366bcc

Please sign in to comment.
Something went wrong with that request. Please try again.