File: signals.py

package info (click to toggle)
sentry-python 2.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,004 kB
  • sloc: python: 55,908; makefile: 114; sh: 111; xml: 2
file content (15 lines) | stat: -rw-r--r-- 375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.core import signals
from django.dispatch import receiver

myapp_custom_signal = signals.Signal()
myapp_custom_signal_silenced = signals.Signal()


@receiver(myapp_custom_signal)
def signal_handler(sender, **kwargs):
    assert sender == "hello"


@receiver(myapp_custom_signal_silenced)
def signal_handler_silenced(sender, **kwargs):
    assert sender == "hello"