From ba7ee3baae106baf48b738e9260a5e9ade9d5e22 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Thu, 10 Oct 2024 13:37:01 +0200 Subject: Add initial poetry files and fix server --- iss/geo.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'iss') 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) -- cgit v1.3.1