From 3c0cc27ea100c39da0c52bfa6d7935ac8dd74002 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 9 Jul 2021 19:52:19 +0200 Subject: [PATCH] events: fix error when slack notification request failed without a response Signed-off-by: Jens Langhammer --- authentik/events/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/events/models.py b/authentik/events/models.py index 904fe06c8..0364e5dd4 100644 --- a/authentik/events/models.py +++ b/authentik/events/models.py @@ -313,7 +313,8 @@ class NotificationTransport(models.Model): response = post(self.webhook_url, json=body) response.raise_for_status() except RequestException as exc: - raise NotificationTransportError(exc.response.text) from exc + text = exc.response.text if exc.response else str(exc) + raise NotificationTransportError(text) from exc return [ response.status_code, response.text,