fix: return correct country from geoip database

Return country instead of registered_country for iso code in get_geolocation
This commit is contained in:
dozed-dev
2025-06-08 19:53:51 +03:00
committed by GitHub
parent 95cc4489d0
commit b08a700314
+1 -1
View File
@@ -259,7 +259,7 @@ def get_geolocation(ip: str) -> Geolocation:
with geoip2.database.Reader(str(MMDB_FILE)) as reader:
resp = reader.city(ip)
iso_code = cast(str, resp.registered_country.iso_code).upper()
iso_code = cast(str, resp.country.iso_code).upper()
location = resp.location
# Check if any required attributes are missing