mirror of
https://github.com/searxng/searxng
synced 2024-11-18 15:26:25 +00:00
Merge pull request #2452 from return42/fix-2434
[fix] ClientPref - don't raise exception if Accept-Language is invalid
This commit is contained in:
commit
cea277ce52
@ -331,8 +331,12 @@ class ClientPref:
|
||||
except (ValueError, babel.core.UnknownLocaleError):
|
||||
continue
|
||||
pairs.append((locale, qvalue))
|
||||
pairs.sort(reverse=True, key=lambda x: x[1])
|
||||
return cls(locale=pairs[0][0])
|
||||
|
||||
locale = None
|
||||
if pairs:
|
||||
pairs.sort(reverse=True, key=lambda x: x[1])
|
||||
locale = pairs[0][0]
|
||||
return cls(locale=locale)
|
||||
|
||||
|
||||
class Preferences:
|
||||
|
Loading…
Reference in New Issue
Block a user