diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2015-01-15 17:05:44 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2015-01-15 17:05:44 +0100 |
| commit | c5599e3c7c790ac2674b68f99919c0ec284327a3 (patch) | |
| tree | de5f0d91028f99d9c01135a17affd40dba6db502 /searx/search.py | |
| parent | a85be122751cc774c2d028aa10162b25081e6642 (diff) | |
| parent | de6064994ef4854ccfb960947398f7b0cd565030 (diff) | |
Merge pull request #174 from pointhi/nojs_fix
add no javascript support to 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 |