summaryrefslogtreecommitdiff
path: root/searx/preferences.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/preferences.py')
-rw-r--r--searx/preferences.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/preferences.py b/searx/preferences.py
index b63bd446b..e4a2ebecd 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -179,7 +179,7 @@ class SearchLanguageSetting(EnumStringSetting):
if data not in self.choices and data != self.value: # pylint: disable=no-member
# hack to give some backwards compatibility with old language cookies
data = str(data).replace('_', '-')
- lang = data.split('-')[0]
+ lang = data.split('-', maxsplit=1)[0]
# pylint: disable=no-member
if data in self.choices:
pass
@@ -503,6 +503,7 @@ class Preferences:
"""Save cookie in the HTTP reponse obect
"""
for user_setting_name, user_setting in self.key_value_settings.items():
+ # pylint: disable=unnecessary-dict-index-lookup
if self.key_value_settings[user_setting_name].locked:
continue
user_setting.save(user_setting_name, resp)