diff --git a/lib/location.py b/lib/location.py index cff6d42..de20339 100644 --- a/lib/location.py +++ b/lib/location.py @@ -158,11 +158,13 @@ def geoip(ip_addr): try: response = GEOIP_READER.city(ip_addr) country = response.country.name + region = response.subdivisions.name city = response.city.name except geoip2.errors.AddressNotFoundError: country = None + region = None city = None - return city, country + return city, region, country def workaround(city, country): # workaround for the strange bug with the country name