[fix] erreur si no result

parent 76a37820
......@@ -26,8 +26,11 @@ def geo_find(addr):
except Exception as e:
raise UserError(_('Cannot contact geolocation servers. Please make sure that your Internet connection is up and running (%s).') % e)
geo = result[0]
return float(geo['lat']), float(geo['lon'])
if len(result) > 0:
geo = result[0]
return float(geo['lat']), float(geo['lon'])
else:
return (0.0, 0.0)
def geo_query_address(street=None, zip=None, city=None,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment