mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-21 08:29:59 +00:00
Remove use of deprecated before_first_request decorator (#1162)
This commit is contained in:
parent
cfcfbc4301
commit
09d0598c2f
@ -1369,15 +1369,16 @@ def healthcheck():
|
||||
return "", 200
|
||||
|
||||
|
||||
@APP.before_first_request
|
||||
@APP.before_request
|
||||
def detect_locale():
|
||||
"""
|
||||
Get the detected locale to use for UI string translations.
|
||||
This requires the Flask app to have started first.
|
||||
"""
|
||||
session["language"] = get_locale()
|
||||
piscsi_cmd.locale = session["language"]
|
||||
file_cmd.locale = session["language"]
|
||||
if "language" not in session.keys():
|
||||
session["language"] = get_locale()
|
||||
piscsi_cmd.locale = session["language"]
|
||||
file_cmd.locale = session["language"]
|
||||
|
||||
|
||||
@APP.before_request
|
||||
|
Loading…
Reference in New Issue
Block a user