Make SignalHook disconnect properly from the signal when a sender was specified in the constructor

Review Request #6410 — Created Oct. 6, 2014 and submitted

Information

Djblets

Reviewers

The Signal.disconnect() method in Django uses a combination of the dispatch_uid and the sender as the lookup key for finding the signal receiver to remove. This means that if SignalHook used a sender in the connect() call, it must provide that same sender when calling disconnect() later.

This issue was causing ReviewBoard extensions that should have been unloaded to be kept alive and continue receiving signals, which in turn led to extension actions happening multiple times.

Added new unit test.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
JO
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.8.x (f76845b)