From ee6880a9f291b24da09b2e2844deeb0dfe14a5b6 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 22 Mar 2022 09:43:41 +0100 Subject: Use lazy translation on intervals' strings Constant strings outside of a request must use lazy strings. See flask-babel documentation for more information. --- ogcp/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ogcp/views.py b/ogcp/views.py index 752db62..01b7a0f 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -25,6 +25,7 @@ from pathlib import Path from ogcp.models import User from ogcp.forms.auth import LoginForm from ogcp.og_server import OGServer +from flask_babel import lazy_gettext as _l from flask_babel import _ from ogcp import app import requests @@ -185,9 +186,9 @@ def get_user(username): intervals = ( - (_('days'), 86400), # 60 * 60 * 24 - (_('hours'), 3600), # 60 * 60 - (_('minutes'), 60), + (_l('days'), 86400), # 60 * 60 * 24 + (_l('hours'), 3600), # 60 * 60 + (_l('minutes'), 60), ) -- cgit v1.2.3-18-g5258