Commit 6060a67a authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

stop using pre 3.10 api, closes #1986427

parent c4bb3e7c2022
......@@ -25,12 +25,12 @@ class AutoSetLatLng(Hook):
geoattrs = set(('street', 'street2', 'postalcode', 'city', 'country'))
changed_attrs = set(self.entity.cw_edited)
if (geoattrs & changed_attrs
and not self.entity.get('latitude')
and not self.entity.get('longitude')):
and not self.entity.cw_attr_cache.get('latitude')
and not self.entity.cw_attr_cache.get('longitude')):
try:
latlng = geocoding.get_latlng(self.entity.dc_long_title(), gmapkey)
except geocoding.UnknownAddress:
self._cw.warning('unable to get latitude / longitude for %s',
self.entity.eid)
else:
self.entity.update(latlng)
self.entity.cw_edited.update(latlng)
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