default to 'en' in celery #51

This commit is contained in:
rimu 2024-05-09 19:30:06 +12:00
parent 7867b5b346
commit 15a86d0f84

View file

@ -20,6 +20,7 @@ from config import Config
def get_locale(): def get_locale():
try:
if session.get('ui_language', None): if session.get('ui_language', None):
return session['ui_language'] return session['ui_language']
else: else:
@ -27,6 +28,8 @@ def get_locale():
return request.accept_languages.best_match(current_app.config['LANGUAGES']) return request.accept_languages.best_match(current_app.config['LANGUAGES'])
except: except:
return 'en' return 'en'
except:
return 'en'
db = SQLAlchemy() # engine_options={'pool_size': 5, 'max_overflow': 10} # session_options={"autoflush": False} db = SQLAlchemy() # engine_options={'pool_size': 5, 'max_overflow': 10} # session_options={"autoflush": False}