From 0273ae16df503312d727208923a77a82d6424890 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 27 Oct 2021 15:38:41 +0200 Subject: [PATCH] events: fix error when notification transport doesn't exist anymore Signed-off-by: Jens Langhammer --- authentik/events/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authentik/events/tasks.py b/authentik/events/tasks.py index d4791f427..4e8499ec9 100644 --- a/authentik/events/tasks.py +++ b/authentik/events/tasks.py @@ -98,7 +98,9 @@ def notification_transport(self: MonitoredTask, notification_pk: int, transport_ notification: Notification = Notification.objects.filter(pk=notification_pk).first() if not notification: return - transport: NotificationTransport = NotificationTransport.objects.get(pk=transport_pk) + transport = NotificationTransport.objects.filter(pk=transport_pk).first() + if not transport: + return transport.send(notification) self.set_status(TaskResult(TaskResultStatus.SUCCESSFUL)) except NotificationTransportError as exc: