diff options
author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-06-05 08:48:47 +0200 |
---|---|---|
committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-06-05 08:48:47 +0200 |
commit | 0978f108879324a0367bc6d362f896532d6fc04f (patch) | |
tree | 24519f6c115db01087b06d9f59ce2870b656b13a /searx/webapp.py | |
parent | aa1b8fa79b0f9f66c2913b5acae5a63545504e70 (diff) | |
download | searxng-0978f108879324a0367bc6d362f896532d6fc04f.tar.gz searxng-0978f108879324a0367bc6d362f896532d6fc04f.zip |
[fix] do not hide categorie inside preferences if there is no engine activated
Diffstat (limited to 'searx/webapp.py')
-rw-r--r-- | searx/webapp.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 8587d546a..dbcbb4c0d 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -279,6 +279,12 @@ def render(template_name, override_theme=None, **kwargs): if x != 'general' and x in nonblocked_categories) + if 'all_categories' not in kwargs: + kwargs['all_categories'] = ['general'] + kwargs['all_categories'].extend(x for x in + sorted(categories.keys()) + if x != 'general') + if 'selected_categories' not in kwargs: kwargs['selected_categories'] = [] for arg in request.args: @@ -286,11 +292,13 @@ def render(template_name, override_theme=None, **kwargs): c = arg.split('_', 1)[1] if c in categories: kwargs['selected_categories'].append(c) + if not kwargs['selected_categories']: cookie_categories = request.cookies.get('categories', '').split(',') for ccateg in cookie_categories: if ccateg in categories: kwargs['selected_categories'].append(ccateg) + if not kwargs['selected_categories']: kwargs['selected_categories'] = ['general'] |