|
|
@ -57,11 +57,9 @@ def get_coordinates(city_name, country_code="US"): |
|
|
|
or None if the city is not found. |
|
|
|
""" |
|
|
|
search_results = gc.search_cities(city_name, case_sensitive=True) |
|
|
|
search_results = { |
|
|
|
k: c |
|
|
|
for k, c in search_results.items() |
|
|
|
if (c.get("countrycode") == country_code) |
|
|
|
} |
|
|
|
search_results = [ |
|
|
|
d for d in search_results if (d.get("countrycode") == country_code) |
|
|
|
] |
|
|
|
|
|
|
|
if not search_results: |
|
|
|
return None |
|
|
|