Commit ceded34a authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[sobjects] Return early in SyncCKANDataset if entity is not ICKANDataset adaptable

parent db3ad7822146
......@@ -87,7 +87,12 @@ class SyncCKANDataset(Service):
"""Create or update a CKAN dataset using dataset-like entity eid"""
entity = self._cw.entity_from_eid(eid)
datasetid = entity.ckan_dataset_id
data = entity.cw_adapt_to('ICKANDataset').ckan_data()
adapter = entity.cw_adapt_to('ICKANDataset')
if adapter is None:
self.debug('not synching %s (not ICKANDataset adaptable)',
entity)
return
data = adapter.ckan_data()
config = self._cw.vreg.config
if datasetid is not None:
update_dataset(config, eid, datasetid, data)
......
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