From 5536382b591361b63dc5ba58ade77520d67dd074 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 19 Dec 2022 16:19:21 +0100 Subject: [PATCH] Don't require ckanext-harvest, fixes #302 --- ckanext/spatial/util.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ckanext/spatial/util.py b/ckanext/spatial/util.py index 3aef130..1f32633 100644 --- a/ckanext/spatial/util.py +++ b/ckanext/spatial/util.py @@ -15,10 +15,14 @@ from pprint import pprint from ckan import model from ckan.model.package_extra import PackageExtra -from ckanext.spatial.lib import save_package_extent -from ckanext.spatial.lib.reports import validation_report -from ckanext.spatial.harvesters import SpatialHarvester -from ckanext.spatial.model import ISODocument +try: + from ckanext.spatial.lib import save_package_extent + from ckanext.spatial.lib.reports import validation_report + from ckanext.spatial.harvesters import SpatialHarvester + from ckanext.spatial.model import ISODocument +except ImportError: + # ckanext-harvest not loaded + pass from ckantoolkit import config