diff options
author | Martin Fischer <martin@push-f.com> | 2022-01-04 15:39:19 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-01-05 11:03:44 +0100 |
commit | b38036d519c8b74d7be972e7b730b50f92fa8db4 (patch) | |
tree | 093ce335b80e8f1dc35b2b802f1ba4ed3fb86214 | |
parent | 3dd534e5c0017670a1e8ed12acfdfead4f2bcd0f (diff) | |
download | searxng-b38036d519c8b74d7be972e7b730b50f92fa8db4.tar.gz searxng-b38036d519c8b74d7be972e7b730b50f92fa8db4.zip |
[fix] stop setting superfluous cookies for "non tab categories"
-rw-r--r-- | searx/preferences.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/preferences.py b/searx/preferences.py index 2a9b0af0c..918a7a300 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -12,6 +12,7 @@ from urllib.parse import parse_qs, urlencode from searx import settings, autocomplete from searx.locales import LOCALE_NAMES from searx.webutils import VALID_LANGUAGE_CODE +from searx.engines import OTHER_CATEGORY COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5 # 5 years @@ -271,6 +272,8 @@ class EnginesSetting(SwitchableSetting): transformed_choices = [] for engine_name, engine in self.choices.items(): # pylint: disable=no-member,access-member-before-definition for category in engine.categories: + if not category in settings['categories_as_tabs'] + [OTHER_CATEGORY]: + continue transformed_choice = {} transformed_choice['default_on'] = not engine.disabled transformed_choice['id'] = '{}__{}'.format(engine_name, category) |