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