mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-29 01:42:37 +02:00
Check that language is in the supported list (#971)
This commit is contained in:
parent
f4c5786597
commit
8b6a2afc63
1 changed files with 5 additions and 2 deletions
|
@ -818,8 +818,11 @@ def edit_bill(bill_id):
|
||||||
|
|
||||||
@main.route("/lang/<lang>")
|
@main.route("/lang/<lang>")
|
||||||
def change_lang(lang):
|
def change_lang(lang):
|
||||||
|
if lang in current_app.config["SUPPORTED_LANGUAGES"]:
|
||||||
session["lang"] = lang
|
session["lang"] = lang
|
||||||
session.update()
|
session.update()
|
||||||
|
else:
|
||||||
|
flash(_(f"{lang} is not a supported language"), category="warning")
|
||||||
|
|
||||||
return redirect(request.headers.get("Referer") or url_for(".home"))
|
return redirect(request.headers.get("Referer") or url_for(".home"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue