events: fix geoip case when not configured
This commit is contained in:
parent
5417d0a90c
commit
bbd088a957
|
@ -144,6 +144,8 @@ class Event(models.Model):
|
||||||
|
|
||||||
def with_geoip(self):
|
def with_geoip(self):
|
||||||
"""Apply GeoIP Data, when enabled"""
|
"""Apply GeoIP Data, when enabled"""
|
||||||
|
if not GEOIP_READER:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
response = GEOIP_READER.city(self.client_ip)
|
response = GEOIP_READER.city(self.client_ip)
|
||||||
self.context["geo"] = {
|
self.context["geo"] = {
|
||||||
|
|
Reference in New Issue