From 511e26fa149fb6e785ad3d590b32345cc4559094 Mon Sep 17 00:00:00 2001 From: amercader Date: Fri, 14 Jun 2013 15:59:45 +0100 Subject: [PATCH] [#15] Check CKAN version when using the Solr Search backend --- ckanext/spatial/plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ckanext/spatial/plugin.py b/ckanext/spatial/plugin.py index 83c913c..3a8dc75 100644 --- a/ckanext/spatial/plugin.py +++ b/ckanext/spatial/plugin.py @@ -127,6 +127,10 @@ class SpatialQuery(p.SingletonPlugin): def configure(self, config): self.search_backend = config.get('ckanext.spatial.search_backend', 'postgis') + if self.search_backend != 'postgis' and not p.toolkit.check_ckan_version('2.0.1'): + msg = 'The Solr backends for the spatial search require CKAN 2.0.1 or higher. ' + \ + 'Please upgrade CKAN or select the \'postgis\' backend.' + raise p.toolkit.CkanVersionException(msg) def before_map(self, map):