|
@ -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 |
|
|