[#15] Check CKAN version when using the Solr Search backend

This commit is contained in:
amercader 2013-06-14 15:59:45 +01:00
parent 9976b6e96f
commit 511e26fa14
1 changed files with 4 additions and 0 deletions

View File

@ -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):