From 08be8787b197346d4047b74ef4dc60b4bb71eea6 Mon Sep 17 00:00:00 2001 From: Gregory Danielson Date: Sun, 1 Nov 2020 13:50:05 -0600 Subject: [PATCH] Observe new region var in get_location --- lib/location.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/location.py b/lib/location.py index 1b1d262..6be90dd 100644 --- a/lib/location.py +++ b/lib/location.py @@ -188,16 +188,16 @@ def get_location(ip_addr): """ for method in IPLOCATION_ORDER: if method == 'geoip': - city, country = geoip(ip_addr) + city, region, country = geoip(ip_addr) elif method == 'ip2location': - city, country = ip2location(ip_addr) + city, region, country = ip2location(ip_addr) elif method == 'ipinfo': - city, country = ipinfo(ip_addr) + city, region, country = ipinfo(ip_addr) else: print("ERROR: invalid iplocation method speficied: %s" % method) if city is not None: - city, country = workaround(city, country) - return city, country + city, region, country = workaround(city, region, country) + return city, region, country # # temporary disabled it because of geoip services capcacity # @@ -210,7 +210,7 @@ def get_location(ip_addr): # pass # No methods resulted in a location - return default - return NOT_FOUND_LOCATION, None + return NOT_FOUND_LOCATION, None, None def location_canonical_name(location):