Remove use of deprecated before_first_request decorator (#1162)

This commit is contained in:
Daniel Markstedt 2023-05-01 19:21:17 -07:00 committed by GitHub
parent cfcfbc4301
commit 09d0598c2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1369,15 +1369,16 @@ def healthcheck():
return "", 200 return "", 200
@APP.before_first_request @APP.before_request
def detect_locale(): def detect_locale():
""" """
Get the detected locale to use for UI string translations. Get the detected locale to use for UI string translations.
This requires the Flask app to have started first. This requires the Flask app to have started first.
""" """
session["language"] = get_locale() if "language" not in session.keys():
piscsi_cmd.locale = session["language"] session["language"] = get_locale()
file_cmd.locale = session["language"] piscsi_cmd.locale = session["language"]
file_cmd.locale = session["language"]
@APP.before_request @APP.before_request