Skip to content

Commit 8eda56d

Browse files
authored
compatibility with ckan 2.10 and older from @duttonw
1 parent c5a0a2f commit 8eda56d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ckanext/xloader/jobs.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ def xloader_data_into_datastore_(input, job_dict, logger):
178178
logger.info('Express Load starting: %s', resource_ckan_url)
179179

180180
# check if the resource url_type is a datastore
181-
if resource.get('url_type') in h.datastore_rw_resource_url_types():
181+
if hasattr(h, "datastore_rw_resource_url_types"):
182+
datastore_rw_resource_url_types = h.datastore_rw_resource_url_types()
183+
else:
184+
#fallback for 2.10.x or older.
185+
datastore_rw_resource_url_types = ['datastore']
186+
187+
if resource.get('url_type') in datastore_rw_resource_url_types:
182188
logger.info('Ignoring resource - R/W DataStore resources are '
183189
'managed with the Datastore API')
184190
return

0 commit comments

Comments
 (0)