From c558824fbf983acce10e2daa8161bbdbde40106e Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sat, 27 Oct 2018 00:58:42 +0200 Subject: [PATCH] rewrite country name (in some cases) --- lib/location.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/location.py b/lib/location.py index 369a239..eb0edb9 100644 --- a/lib/location.py +++ b/lib/location.py @@ -133,6 +133,11 @@ def get_location(ip_addr): if city is None: city, country = ip2location(ip_addr) + # workaround for the strange bug with the country name + # maybe some other countries has this problem too + if country == 'Russian Federation': + country = 'Russia' + if city: return city, country else: