bugfix
This commit is contained in:
parent
4e2e160072
commit
4c36e07085
@ -57,11 +57,9 @@ def get_coordinates(city_name, country_code="US"):
|
|||||||
or None if the city is not found.
|
or None if the city is not found.
|
||||||
"""
|
"""
|
||||||
search_results = gc.search_cities(city_name, case_sensitive=True)
|
search_results = gc.search_cities(city_name, case_sensitive=True)
|
||||||
search_results = {
|
search_results = [
|
||||||
k: c
|
d for d in search_results if (d.get("countrycode") == country_code)
|
||||||
for k, c in search_results.items()
|
]
|
||||||
if (c.get("countrycode") == country_code)
|
|
||||||
}
|
|
||||||
|
|
||||||
if not search_results:
|
if not search_results:
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user