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