Commit 75612c6a authored by Samuel Trégouët's avatar Samuel Trégouët
Browse files

[views] fix boolean value

previously bool value was 0 or 1 it seems that elasticsearch 6 will not cast
this value anymore
parent 375b6fe412de
......@@ -101,9 +101,15 @@ class ElasticSearchView(StartupView):
if key.startswith('es_'):
# FIXME TODO have better typing mechanisme (inspect facets?)
try:
facet_selections[key.replace('es_', '')] = int(value)
if value.lower() == 'true':
value = True
elif value.lower() == 'false':
value = False
else:
value = int(value)
except ValueError:
facet_selections[key.replace('es_', '')] = value
pass
facet_selections[key.replace('es_', '')] = value
if key == 'page':
try:
start = (max(int(value) - 1, 0)) * 10
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment