Improved testability

Less content exposed with restricted content
Tornado restart and stop working with systemd
This commit is contained in:
Ozzieisaacs
2020-02-15 09:08:39 +01:00
parent 726595e117
commit 8b1444ebc2
5 changed files with 14 additions and 10 deletions

View File

@ -723,7 +723,8 @@ def tags_filters():
# Creates for all stored languages a translated speaking name in the array for the UI
def speaking_language(languages=None):
if not languages:
languages = db.session.query(db.Languages).all()
languages = db.session.query(db.Languages).join(db.books_languages_link).join(db.Books).filter(common_filters())\
.group_by(text('books_languages_link.lang_code')).all()
for lang in languages:
try:
cur_l = LC.parse(lang.lang_code)