From f72d6da52124dfaf34148fb942c67f845556222a Mon Sep 17 00:00:00 2001 From: amercader Date: Thu, 19 Mar 2015 12:48:46 +0000 Subject: [PATCH] Change toolkit import Apparently on package installs this is not well supported from ckan.plugins.toolkit import check_ckan_version But this works: from ckan.plugins import toolkit toolkit.check_ckan_version(... --- ckanext/harvest/logic/action/update.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/logic/action/update.py b/ckanext/harvest/logic/action/update.py index b4f779b..02eae72 100644 --- a/ckanext/harvest/logic/action/update.py +++ b/ckanext/harvest/logic/action/update.py @@ -17,7 +17,8 @@ from ckan.lib.search.common import SearchIndexError, make_connection from ckan.model import Package from ckan import logic -from ckan.plugins.toolkit import check_ckan_version +from ckan.plugins import toolkit + from ckan.logic import NotFound, check_access @@ -119,7 +120,7 @@ def harvest_source_clear(context,data_dict): harvest_source_id=harvest_source_id) # CKAN-2.3 or above: delete resource views, resource revisions & resources - if check_ckan_version(min_version='2.3'): + if toolkit.check_ckan_version(min_version='2.3'): sql += ''' delete from resource_view where resource_id in (select id from resource where package_id in (select id from package where state = 'to_delete' )); delete from resource_revision where package_id in (select id from package where state = 'to_delete' );