Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ckanext/xloader/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import sqlalchemy as sa

from ckan import model
from ckan.plugins.toolkit import get_action, asbool, enqueue_job, ObjectNotFound, config
from ckan.plugins.toolkit import get_action, asbool, enqueue_job, ObjectNotFound, config, h

from . import db, loader
from .job_exceptions import JobError, HTTPError, DataTooBigError, FileCouldNotBeLoadedError
Expand Down Expand Up @@ -178,8 +178,8 @@ def xloader_data_into_datastore_(input, job_dict, logger):
logger.info('Express Load starting: %s', resource_ckan_url)

# check if the resource url_type is a datastore
if resource.get('url_type') == 'datastore':
logger.info('Ignoring resource - url_type=datastore - dump files are '
if resource.get('url_type') in h.datastore_rw_resource_url_types():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs backwards support for for 2.10.x since datastore_rw_resource_url_types only exists in 2.11.

https://github.com/ckan/ckan/blob/ckan-2.11.1/ckanext/datastore/helpers.py#L242 (exists since May 2023)
https://github.com/ckan/ckan/blob/ckan-2.10.6/ckanext/datastore/helpers.py (does not include 'datastore_rw_resource_url_types' )

i.e.

if hasattr(h, "datastore_rw_resource_url_types"):
             datastore_rw_resource_url_types = h.datastore_rw_resource_url_types()
else:
             #fallback for 2.10.x or older.
             datastore_rw_resource_url_types = ['datastore']
           
if resource.get('url_type') in datastore_rw_resource_url_types :

logger.info('Ignoring resource - R/W DataStore resources are '
'managed with the Datastore API')
return

Expand Down
Loading