Commit 92040c24 authored by thepaeth's avatar thepaeth
Browse files

fix bug

parent 31895980
......@@ -86,6 +86,8 @@ class HierarchyDisplay(p.SingletonPlugin):
sub-organizations too. This is achieved by modifying the search options
before they go to SOLR.
'''
if search_params.get('rows') == 0:
return search_params
# Check if we're called from the organization controller, as detected
# by c being registered for this thread, and the existence of c.fields
# values
......@@ -140,14 +142,14 @@ class HierarchyDisplay(p.SingletonPlugin):
# add the org clause
query = query.strip()
if query:
query += ' AND '
query += ' +'
query += '({})'.format(
' OR '.join(
'organization:{}'.format(org_name)
for org_name in [c.group_dict.get('name')] +
children_names))
else:
query += ' AND (organization:{})'.format(c.group_dict.get('name'))
query += ' +(organization:{})'.format(c.group_dict.get('name'))
search_params['q'] = query.strip()
......@@ -156,7 +158,7 @@ class HierarchyDisplay(p.SingletonPlugin):
# remove include_children from the filter-list - we have a checkbox
del c.fields_grouped['include_children']
search_params['fq'] = ''
search_params['fq'] = 'type:dataset'
check_include_children = {}
return search_params
......
Supports Markdown
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