mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 14:37:36 +01:00
Fix crash when sending emails
This commit is contained in:
parent
db4e3dabb7
commit
ec6f16c229
@ -121,11 +121,14 @@ def page_not_found(e):
|
|||||||
def get_locale():
|
def get_locale():
|
||||||
locales = app.config["LANGUAGES"].keys()
|
locales = app.config["LANGUAGES"].keys()
|
||||||
|
|
||||||
locale = request.cookies.get("locale")
|
if request:
|
||||||
if locale in locales:
|
locale = request.cookies.get("locale")
|
||||||
return locale
|
if locale in locales:
|
||||||
|
return locale
|
||||||
|
|
||||||
return request.accept_languages.best_match(locales)
|
return request.accept_languages.best_match(locales)
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@app.route("/set-locale/", methods=["POST"])
|
@app.route("/set-locale/", methods=["POST"])
|
||||||
|
Loading…
Reference in New Issue
Block a user