diff options
| author | Yuval Adam <_@yuv.al> | 2024-10-10 13:37:01 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2024-10-10 13:37:01 +0200 |
| commit | ba7ee3baae106baf48b738e9260a5e9ade9d5e22 (patch) | |
| tree | a53b8d0bbd4dcf8edc2cc176e093548ca02fdd1e /iss | |
| parent | fc09f4b8d9824234da44ef565ffb932f35f05095 (diff) | |
Add initial poetry files and fix server
Diffstat (limited to 'iss')
| -rw-r--r-- | iss/geo.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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) |
