Fix crash when sending emails

This commit is contained in:
rubenwardy 2022-01-08 02:42:48 +00:00
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():