From d08bc4fd1dab191db5ee01e81509c9b9b33c710d Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Fri, 8 Dec 2023 01:15:10 +0100 Subject: reorder run arguments it somehow works now?!!?! don't use getex command for redis set lang_code more explicit --- src/jwebmail/webmail.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/jwebmail/webmail.py') diff --git a/src/jwebmail/webmail.py b/src/jwebmail/webmail.py index 26dfe20..5ddc5d6 100644 --- a/src/jwebmail/webmail.py +++ b/src/jwebmail/webmail.py @@ -10,7 +10,7 @@ from flask import ( request, url_for, ) -from flask_babel import gettext, lazy_gettext +from flask_babel import get_locale, gettext, lazy_gettext from flask_login import current_user, login_user, logout_user from flask_paginate import Pagination, get_page_parameter, get_per_page_parameter from flask_wtf import FlaskForm @@ -66,8 +66,9 @@ def login(): if urlparse(nxt).netloc: abort(401) - g.setdefault("lang_code", current_app.config["BABEL_DEFAULT_LOCALE"]) - return redirect(nxt or url_for("displayheaders"), 303) + return redirect( + nxt or url_for("displayheaders", lang_code=get_locale().language), 303 + ) else: warn = gettext("login failed!") elif request.method == "POST": -- cgit v1.2.3