diff --git a/searx/preferences.py b/searx/preferences.py index b0f8887c3..f70aee37a 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -326,43 +326,51 @@ class Preferences(object): ['general'], choices=categories + ['none'] ), 'language': SearchLanguageSetting( - settings['search']['default_lang'], + settings['search'].get('default_lang', ''), choices=list(LANGUAGE_CODES) + [''] ), 'locale': EnumStringSetting( - settings['ui']['default_locale'], + settings['ui'].get('default_locale', ''), choices=list(settings['locales'].keys()) + [''] ), 'autocomplete': EnumStringSetting( - settings['search']['autocomplete'], + settings['search'].get('autocomplete', ''), choices=list(autocomplete.backends.keys()) + [''] ), 'image_proxy': MapSetting( - settings['server']['image_proxy'], - map={ '': settings['server']['image_proxy'], - '0': False, - '1': True, - 'True': True, - 'False': False} + settings['server'].get('image_proxy', False), + map={ + '': settings['server'].get('image_proxy', 0), + '0': False, + '1': True, + 'True': True, + 'False': False + } ), 'method': EnumStringSetting( 'POST', choices=('GET', 'POST') ), 'safesearch': MapSetting( - settings['search']['safe_search'], - map={'0': 0, - '1': 1, - '2': 2}), + settings['search'].get('safe_search', 0), + map={ + '0': 0, + '1': 1, + '2': 2 + } + ), 'theme': EnumStringSetting( - settings['ui']['default_theme'], + settings['ui'].get('default_theme', 'oscar'), choices=themes ), 'results_on_new_tab': MapSetting( False, - map ={'0': False, '1': True, - 'False': False, - 'True': True} + map={ + '0': False, + '1': True, + 'False': False, + 'True': True + } ), 'doi_resolver': MultipleChoiceSetting( ['oadoi.org'], choices=DOI_RESOLVERS diff --git a/searx/settings_robot.yml b/searx/settings_robot.yml index 25f229e56..33e762689 100644 --- a/searx/settings_robot.yml +++ b/searx/settings_robot.yml @@ -3,8 +3,6 @@ general: instance_name : "searx_test" search: - safe_search : 0 - autocomplete : "" language: "all" server: @@ -12,14 +10,12 @@ server: bind_address : 127.0.0.1 secret_key : "ultrasecretkey" # change this! base_url : False - image_proxy : False http_protocol_version : "1.0" ui: static_path : "" templates_path : "" default_theme : oscar - default_locale : "" outgoing: request_timeout : 1.0 # seconds