summaryrefslogtreecommitdiff
path: root/chimere/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-09-28 09:53:49 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-09-28 09:53:49 +0200
commit4a37fa206752e4816a0f9e182dba2d7db2fae54f (patch)
treeba6813f05968678c468386711cf1ba3c755986c6 /chimere/views.py
parente4f39ab814f4d0b616844cca8d1dbc7748dda24c (diff)
downloadChimère-4a37fa206752e4816a0f9e182dba2d7db2fae54f.tar.bz2
Chimère-4a37fa206752e4816a0f9e182dba2d7db2fae54f.zip
Change CHIMERE_SEARCH_ENGINE to HAYSTACK_SEARCH_ENGINE
Diffstat (limited to 'chimere/views.py')
-rw-r--r--chimere/views.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/chimere/views.py b/chimere/views.py
index 7a1ff66..0a4c1f9 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -213,8 +213,8 @@ def index(request, area_name=None, default_area=None, simple=False,
'dynamic_categories': response_dct['dynamic_categories'],
'zoomout': zoomout,
'has_default_area': Area.objects.filter(default=True).count(),
- 'has_search': hasattr(settings, 'CHIMERE_SEARCH_ENGINE') and
- settings.CHIMERE_SEARCH_ENGINE
+ 'has_search': response_dct['area'].use_search if response_dct['area']
+ else None,
})
if hasattr(settings, 'PROJECT_IMAGE') and settings.PROJECT_IMAGE:
response_dct['PROJECT_IMAGE'] = settings.PROJECT_IMAGE
@@ -1272,8 +1272,8 @@ def property_choice_list(request, area_name='', property_slug=''):
SearchView = None
autocomplete = None
-if hasattr(settings, 'CHIMERE_SEARCH_ENGINE') \
- and settings.CHIMERE_SEARCH_ENGINE:
+
+if getattr(settings, 'HAYSTACK_SEARCH_ENGINE', None):
from haystack.views import SearchView as HaystackSearchView
from haystack.query import SearchQuerySet
@@ -1301,3 +1301,6 @@ if hasattr(settings, 'CHIMERE_SEARCH_ENGINE') \
'spelling': spelling,
})
return HttpResponse(the_data, content_type='application/json')
+else:
+ # TODO SEARCH
+ pass