Tolerate double registration of signal handlers
authorMikko Värri <vmj@linuxbox.fi>
Tue, 2 Feb 2010 00:50:35 +0000 (02:50 +0200)
committerMikko Värri <vmj@linuxbox.fi>
Tue, 2 Feb 2010 00:50:35 +0000 (02:50 +0200)
recycloid_models/models.py

index 4adb7a0..9d1e028 100644 (file)
@@ -214,7 +214,8 @@ def on__user__post_save(sender, *args, **kwargs):
     else:
         print " - User only modified"
 
-post_save.connect(on__user__post_save, sender=User)
+post_save.connect(on__user__post_save, sender=User,
+                  dispatch_uid="recycloid_models.models.on__user__post_save")
 
 
 def on__stash_item__post_save(sender, *args, **kwargs):
@@ -236,7 +237,8 @@ def on__stash_item__post_save(sender, *args, **kwargs):
     else:
         print " - StashItem only modified"
 
-post_save.connect(on__stash_item__post_save, sender=StashItem)
+post_save.connect(on__stash_item__post_save, sender=StashItem,
+                  dispatch_uid="recycloid_models.models.on__stash_item__post_save")
 
 
 def on__stash_item__pre_delete(sender, *args, **kwargs):
@@ -253,4 +255,5 @@ def on__stash_item__pre_delete(sender, *args, **kwargs):
     else:
         print " - No instance"
 
-pre_delete.connect(on__stash_item__pre_delete, sender=StashItem)
+pre_delete.connect(on__stash_item__pre_delete, sender=StashItem,
+                   dispatch_uid="recycloid_models.models.on__stash_item__pre_delete")