summaryrefslogtreecommitdiff
path: root/iss
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-10-10 13:37:01 +0200
committerYuval Adam <_@yuv.al>2024-10-10 13:37:01 +0200
commitba7ee3baae106baf48b738e9260a5e9ade9d5e22 (patch)
treea53b8d0bbd4dcf8edc2cc176e093548ca02fdd1e /iss
parentfc09f4b8d9824234da44ef565ffb932f35f05095 (diff)
Add initial poetry files and fix server
Diffstat (limited to 'iss')
-rw-r--r--iss/geo.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/iss/geo.py b/iss/geo.py
index 5413913..a191d5a 100644
--- a/iss/geo.py
+++ b/iss/geo.py
@@ -16,6 +16,8 @@ default_location = namedtuple("Location", DEFAULT_LOCATION.keys())(
def get_location(ip):
+ if not GEOIP_GEOLITE2_CITY_PATH:
+ return default_location
with geoip2.database.Reader(GEOIP_GEOLITE2_CITY_PATH) as reader:
try:
res = reader.city(ip)