From 1960eedc813b878ab193ff84ae10054ca4e0eccd Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Thu, 11 Aug 2022 21:55:46 +0200 Subject: serve a stub of meta-site for proxy configuration --- src/hydrilla/translations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/hydrilla/translations.py') diff --git a/src/hydrilla/translations.py b/src/hydrilla/translations.py index a963e82..84c565a 100644 --- a/src/hydrilla/translations.py +++ b/src/hydrilla/translations.py @@ -57,10 +57,12 @@ def select_best_locale() -> str: use_flask = False if use_flask: - return flask.request.accept_languages.best_match( + best = flask.request.accept_languages.best_match( supported_locales, default=default_locale ) + assert best is not None + return best # https://stackoverflow.com/questions/3425294/how-to-detect-the-os-default-language-in-python # I am not going to surrender to Microbugs' nonfree, crappy OS to test it, -- cgit v1.2.3