From bbd088a957ce8d075f5f859d8267547faf55fb8c Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 12 Feb 2021 10:43:00 +0100 Subject: [PATCH] events: fix geoip case when not configured --- authentik/events/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/authentik/events/models.py b/authentik/events/models.py index f2b53a728..14911fb38 100644 --- a/authentik/events/models.py +++ b/authentik/events/models.py @@ -144,6 +144,8 @@ class Event(models.Model): def with_geoip(self): """Apply GeoIP Data, when enabled""" + if not GEOIP_READER: + return try: response = GEOIP_READER.city(self.client_ip) self.context["geo"] = {