mirror of https://github.com/searx/searx
Add check if tag_prviacy_violators is true add it to config()
This commit is contained in:
parent
6a5bb59099
commit
01fde7f02d
|
@ -84,7 +84,7 @@ from searx.poolrequests import get_global_proxies
|
||||||
from searx.answerers import ask
|
from searx.answerers import ask
|
||||||
from searx.metrology.error_recorder import errors_per_engines
|
from searx.metrology.error_recorder import errors_per_engines
|
||||||
from searx.settings_loader import get_default_settings_path
|
from searx.settings_loader import get_default_settings_path
|
||||||
from searx.tagprivacyviolators import TagPrivacyViolators
|
from searx.tag_privacy_violators import TagPrivacyViolators
|
||||||
tag_websites = TagPrivacyViolators()
|
tag_websites = TagPrivacyViolators()
|
||||||
# serve pages with HTTP/1.1
|
# serve pages with HTTP/1.1
|
||||||
from werkzeug.serving import WSGIRequestHandler
|
from werkzeug.serving import WSGIRequestHandler
|
||||||
|
@ -624,7 +624,8 @@ def search():
|
||||||
|
|
||||||
# results
|
# results
|
||||||
results = result_container.get_ordered_results()
|
results = result_container.get_ordered_results()
|
||||||
privacy_violators = tag_websites.find_privacy_violators(results)
|
if request.preferences.get_value('tag_privacy_violators'):
|
||||||
|
privacy_violators = tag_websites.find_privacy_violators(results)
|
||||||
number_of_results = result_container.results_number()
|
number_of_results = result_container.results_number()
|
||||||
if number_of_results < result_container.results_length():
|
if number_of_results < result_container.results_length():
|
||||||
number_of_results = 0
|
number_of_results = 0
|
||||||
|
@ -1105,6 +1106,7 @@ def config():
|
||||||
'default_locale': settings['ui']['default_locale'],
|
'default_locale': settings['ui']['default_locale'],
|
||||||
'autocomplete': settings['search']['autocomplete'],
|
'autocomplete': settings['search']['autocomplete'],
|
||||||
'safe_search': settings['search']['safe_search'],
|
'safe_search': settings['search']['safe_search'],
|
||||||
|
'tag_privacy_violators': settings['search']['tag_privacy_violators'],
|
||||||
'default_theme': settings['ui']['default_theme'],
|
'default_theme': settings['ui']['default_theme'],
|
||||||
'version': VERSION_STRING,
|
'version': VERSION_STRING,
|
||||||
'brand': {
|
'brand': {
|
||||||
|
|
Loading…
Reference in New Issue