diff options
author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-15 15:48:50 +0100 |
---|---|---|
committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-15 15:48:50 +0100 |
commit | 5bfaabeb6bb50844fd7389770eb5c8a64e63f13e (patch) | |
tree | ec45932ffb7ca7e3d746d94795e029a9e9bd4a20 /searx/search.py | |
parent | 410dbc573bbb873a447710e122faefd11075b6df (diff) | |
download | searxng-5bfaabeb6bb50844fd7389770eb5c8a64e63f13e.tar.gz searxng-5bfaabeb6bb50844fd7389770eb5c8a64e63f13e.zip |
[enh] add nojs support into oscar-template
Diffstat (limited to 'searx/search.py')
-rw-r--r-- | searx/search.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/searx/search.py b/searx/search.py index 427da3bab..0324d4aaf 100644 --- a/searx/search.py +++ b/searx/search.py @@ -384,12 +384,17 @@ class Search(object): for pd_name, pd in self.request_data.items(): if pd_name.startswith('category_'): category = pd_name[9:] + # if category is not found in list, skip if category not in categories: continue - # add category to list - self.categories.append(category) + if pd != 'off': + # add category to list + self.categories.append(category) + elif category in self.categories: + # remove category from list if property is set to 'off' + self.categories.remove(category) # if no category is specified for this search, # using user-defined default-configuration which |