Spaces:
Runtime error
Runtime error
Commit
Β·
26acc8d
1
Parent(s):
a7316fd
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -114,7 +114,7 @@ class Tools:
|
|
| 114 |
place_2 = place_2["name"]
|
| 115 |
|
| 116 |
if len(latlong_1) == 0 or len(latlong_2) == 0:
|
| 117 |
-
|
| 118 |
|
| 119 |
latlong1 = latlong_1[0]["geometry"]["location"]
|
| 120 |
latlong2 = latlong_2[0]["geometry"]["location"]
|
|
@@ -161,7 +161,7 @@ class Tools:
|
|
| 161 |
latlong = geocode_result[0]["geometry"]["location"]
|
| 162 |
location = (latlong["lat"], latlong["lng"])
|
| 163 |
else:
|
| 164 |
-
|
| 165 |
|
| 166 |
type_of_place = " ".join(type_of_place)
|
| 167 |
# Perform the search using Google Places API
|
|
|
|
| 114 |
place_2 = place_2["name"]
|
| 115 |
|
| 116 |
if len(latlong_1) == 0 or len(latlong_2) == 0:
|
| 117 |
+
return "No place found for the query. Please be more explicit."
|
| 118 |
|
| 119 |
latlong1 = latlong_1[0]["geometry"]["location"]
|
| 120 |
latlong2 = latlong_2[0]["geometry"]["location"]
|
|
|
|
| 161 |
latlong = geocode_result[0]["geometry"]["location"]
|
| 162 |
location = (latlong["lat"], latlong["lng"])
|
| 163 |
else:
|
| 164 |
+
return []
|
| 165 |
|
| 166 |
type_of_place = " ".join(type_of_place)
|
| 167 |
# Perform the search using Google Places API
|