summaryrefslogtreecommitdiff
path: root/searx/preferences.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2023-02-20 12:17:38 +0100
committerGitHub <noreply@github.com>2023-02-20 12:17:38 +0100
commitd669da81fbe820df2d97c98560d00dee32979dc9 (patch)
tree4cbaf3332893934640c8ff0724bcc2019b579618 /searx/preferences.py
parent60e181607def7b48185728e1fd395c0036bd65fb (diff)
parent0b1444b61eb12a2d23d4c95e2440f24161daaec7 (diff)
Merge pull request #2027 from dalf/fix_2018
Add "auto" as a language.
Diffstat (limited to 'searx/preferences.py')
-rw-r--r--searx/preferences.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/preferences.py b/searx/preferences.py
index 3d23c9331..0eac8441c 100644
--- a/searx/preferences.py
+++ b/searx/preferences.py
@@ -154,7 +154,7 @@ class SearchLanguageSetting(EnumStringSetting):
"""Available choices may change, so user's value may not be in choices anymore"""
def _validate_selection(self, selection):
- if selection != '' and not VALID_LANGUAGE_CODE.match(selection):
+ if selection != '' and selection != 'auto' and not VALID_LANGUAGE_CODE.match(selection):
raise ValidationException('Invalid language code: "{0}"'.format(selection))
def parse(self, data: str):