From 22489c4b5f927af5d74b3670b917aee0732543cc Mon Sep 17 00:00:00 2001 From: renyhp Date: Mon, 23 Nov 2020 19:13:29 +0100 Subject: [PATCH] Patch advanced search preferences --- searx/preferences.py | 4 +++- searx/webapp.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/searx/preferences.py b/searx/preferences.py index b37f0104a..a9f16ff78 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -397,11 +397,13 @@ class Preferences: choices=['', 'logicodev', 'logicodev-dark', 'pointhi']), 'advanced_search': MapSetting( settings['ui'].get('advanced_search', False), + is_locked('advanced_search'), map={ '0': False, '1': True, 'False': False, - 'True': True + 'True': True, + 'on': True, } ), } diff --git a/searx/webapp.py b/searx/webapp.py index c0530a834..b1fa84ced 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -546,7 +546,7 @@ def index(): """Render index page.""" # UI - advanced_search = request.form.get('advanced_search', request.preferences.get_value('advanced_search')) + advanced_search = request.preferences.get_value('advanced_search') # redirect to search if there's a query in the request if request.form.get('q'): @@ -611,7 +611,7 @@ def search(): return redirect(result_container.redirect_url) # UI - advanced_search = request.form.get('advanced_search', None) + advanced_search = request.preferences.get_value('advanced_search') # Server-Timing header request.timings = result_container.get_timings()