From 9a7cbc854edab3c23f22914422f03cf8795be17a Mon Sep 17 00:00:00 2001 From: Mikael Karlsson Date: Thu, 6 Oct 2016 17:06:56 +0300 Subject: [PATCH] Use get with default --- ckanext/datesearch/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/datesearch/plugin.py b/ckanext/datesearch/plugin.py index e819afa..caaa484 100644 --- a/ckanext/datesearch/plugin.py +++ b/ckanext/datesearch/plugin.py @@ -33,7 +33,7 @@ class DateSearchPlugin(plugins.SingletonPlugin): end_date = '*' # Add a date-range query with the selected start and/or end dates into the Solr facet queries. - fq = search_params['fq'] + fq = search_params.get('fq', '') fq = '{fq} +extras_PublicationTimestamp:[{sd} TO {ed}]'.format(fq=fq, sd=start_date, ed=end_date) search_params['fq'] = fq