Going green with empty requests that leads to 404 responses

This commit is contained in:
Mario de Frutos 2018-01-31 12:11:07 +01:00
parent 850dc09a4f
commit 3583cc6f47

View File

@ -60,7 +60,10 @@ class MapboxGeocoder(Traceable):
@qps_retry(qps=10)
def geocode(self, searchtext, city=None, state_province=None,
country=None):
address = [searchtext]
if not searchtext:
return []
else:
address = [searchtext]
if city:
address.append(city)
if state_province: