events: ignore notification non-existent in transport

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-28 20:15:00 +02:00
parent 262a8b5ae8
commit 5d3931c128
1 changed files with 3 additions and 1 deletions

View File

@ -105,7 +105,9 @@ def notification_transport(
"""Send notification over specified transport""" """Send notification over specified transport"""
self.save_on_success = False self.save_on_success = False
try: try:
notification: Notification = Notification.objects.get(pk=notification_pk) notification: Notification = Notification.objects.filter(pk=notification_pk).first()
if not notification:
return
transport: NotificationTransport = NotificationTransport.objects.get( transport: NotificationTransport = NotificationTransport.objects.get(
pk=transport_pk pk=transport_pk
) )