Fix stupid typo that crashes Country DB lookups.

This commit is contained in:
Manuel Friedli 2021-07-15 21:55:10 +02:00
parent 0062ae0b2b
commit 5a7dfe7e3c

View file

@ -45,7 +45,7 @@ def get_county_code(ipaddress, dbfile):
country = None
if dbtype == 'GeoLite2-City' or dbtype == 'GeoIP2-City':
country = reader.city(ipaddress).country
elif dbfile == 'GeoLite2-Country' or dbtype == 'GeoIP2-Country':
elif dbtype == 'GeoLite2-Country' or dbtype == 'GeoIP2-Country':
country = reader.country(ipaddress).country
# ASN is not supported
# elif dbfile == 'GeoLite2-ASN' or dbtype == 'GeoIP2-ASN':
@ -87,7 +87,7 @@ def get_details(ipaddress, dbfile):
network = None
if dbtype == 'GeoLite2-City' or dbtype == 'GeoIP2-City':
result = reader.city(ipaddress)
elif dbfile == 'GeoLite2-Country' or dbtype == 'GeoIP2-Country':
elif dbtype == 'GeoLite2-Country' or dbtype == 'GeoIP2-Country':
result = reader.country(ipaddress)
# ASN is not supported
# elif dbfile == 'GeoLite2-ASN' or dbtype == 'GeoIP2-ASN':