Skip to content

Instantly share code, notes, and snippets.

@imsickofmaps
Created April 21, 2016 11:36
Show Gist options
  • Save imsickofmaps/bd89b12fe063da5414b20f166dd6784b to your computer and use it in GitHub Desktop.
Save imsickofmaps/bd89b12fe063da5414b20f166dd6784b to your computer and use it in GitHub Desktop.
List details on who is getting post_save signals
import inspect
from django.db.models.signals import post_save
msg = '{name} in line {line} of {path}'
for receiver in post_save.receivers:
_, receiver = receiver
receiver = receiver()
print(msg.format(name=receiver.__name__, line=inspect.getsourcelines(receiver)[1], path=inspect.getsourcefile(receiver)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment