summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorMartin Minka <martin.minka@gmail.com>2022-01-09 15:53:58 +0100
committerMartin Minka <martin.minka@gmail.com>2022-01-09 15:53:58 +0100
commitb76a81582781ebb11134b68d8d5dae3d245f88cd (patch)
tree8eb487a7ed1c040fdfbf7f3a202dcbf2a3e3b2fe /searx/webapp.py
parent3fbefb4d99ee4f8e2705f1537393dced94b53180 (diff)
downloadsearxng-b76a81582781ebb11134b68d8d5dae3d245f88cd.tar.gz
searxng-b76a81582781ebb11134b68d8d5dae3d245f88cd.zip
[fix] filtered_engines were not correctly evaluating validate_token()
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 46b838b77..3df9f2876 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -932,7 +932,7 @@ def preferences():
allowed_plugins = request.preferences.plugins.get_enabled()
# stats for preferences page
- filtered_engines = dict(filter(lambda kv: (kv[0], request.preferences.validate_token(kv[1])), engines.items()))
+ filtered_engines = dict(filter(lambda kv: request.preferences.validate_token(kv[1]), engines.items()))
engines_by_category = {}
@@ -1163,7 +1163,7 @@ def stats():
sort_order = request.args.get('sort', default='name', type=str)
selected_engine_name = request.args.get('engine', default=None, type=str)
- filtered_engines = dict(filter(lambda kv: (kv[0], request.preferences.validate_token(kv[1])), engines.items()))
+ filtered_engines = dict(filter(lambda kv: request.preferences.validate_token(kv[1]), engines.items()))
if selected_engine_name:
if selected_engine_name not in filtered_engines:
selected_engine_name = None
@@ -1210,7 +1210,7 @@ def stats():
@app.route('/stats/errors', methods=['GET'])
def stats_errors():
- filtered_engines = dict(filter(lambda kv: (kv[0], request.preferences.validate_token(kv[1])), engines.items()))
+ filtered_engines = dict(filter(lambda kv: request.preferences.validate_token(kv[1]), engines.items()))
result = get_engine_errors(filtered_engines)
return jsonify(result)