events: fix geoip case when not configured

This commit is contained in:
Jens Langhammer 2021-02-12 10:43:00 +01:00
parent 5417d0a90c
commit bbd088a957

View file

@ -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"] = {