[fix] categories can't be removed from UI (categories_as_tabs)

When using ``use_default_settings: true``, removing default categories from
settings.yml will not remove them from the UI.

The value ``categories_as_tabs`` is a dictionary type (a4c2cfb) and dictionary
types are merged additive by ``settings_loader.update_settings()``.

This patch replaces the default ``categories_as_tabs`` by the one from the
``user_settings``.

Related: https://github.com/searxng/searxng/issues/1019#issuecomment-1193145654
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2022-07-23 18:46:05 +02:00
parent 464e69665c
commit 0c4003ab2d
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ def update_settings(default_settings, user_settings):
else:
default_settings[k] = v
categories_as_tabs = user_settings.get('categories_as_tabs')
if categories_as_tabs:
default_settings['categories_as_tabs'] = categories_as_tabs
# parse the engines
remove_engines = None
keep_only_engines = None