From 0c4003ab2d0a46439bb51585a91c87f9f755b727 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 23 Jul 2022 18:46:05 +0200 Subject: [PATCH] [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 --- searx/settings_loader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/searx/settings_loader.py b/searx/settings_loader.py index 777b25171..7d481dcea 100644 --- a/searx/settings_loader.py +++ b/searx/settings_loader.py @@ -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