rewrite country name (in some cases)
This commit is contained in:
parent
dbb8aab676
commit
c558824fbf
1 changed files with 5 additions and 0 deletions
|
|
@ -133,6 +133,11 @@ def get_location(ip_addr):
|
||||||
if city is None:
|
if city is None:
|
||||||
city, country = ip2location(ip_addr)
|
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:
|
if city:
|
||||||
return city, country
|
return city, country
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue