From ffc97905f32ec3ee96367b9f18b60e21a5424a3e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 1 Feb 2023 19:39:57 +0100 Subject: [PATCH] events: prevent error when request fails without response closes #4589 Signed-off-by: Jens Langhammer --- authentik/events/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authentik/events/models.py b/authentik/events/models.py index d84f73dc3..53b9dd8e3 100644 --- a/authentik/events/models.py +++ b/authentik/events/models.py @@ -361,7 +361,9 @@ class NotificationTransport(SerializerModel): ) response.raise_for_status() except RequestException as exc: - raise NotificationTransportError(exc.response.text) from exc + raise NotificationTransportError( + exc.response.text if exc.response else str(exc) + ) from exc return [ response.status_code, response.text,