From 400f6e02a5a951835ed69f842b940a6ee2160ee1 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sat, 7 Nov 2020 11:44:02 +0100 Subject: [PATCH] Fix #1668 (upload of books with language set to different than UI language and not showing all books) Fix for only showing external port if kobo is really activated in admin menu --- cps/admin.py | 3 ++- cps/editbooks.py | 2 +- cps/templates/admin.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cps/admin.py b/cps/admin.py index c0d1f39c..409c5619 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -131,8 +131,9 @@ def admin(): allUser = ub.session.query(ub.User).all() email_settings = config.get_mail_settings() + kobo_support = feature_support['kobo'] and config.config_kobo_sync return render_title_template("admin.html", allUser=allUser, email=email_settings, config=config, commit=commit, - feature_support=feature_support, + feature_support=feature_support, kobo_support=kobo_support, title=_(u"Admin page"), page="admin") diff --git a/cps/editbooks.py b/cps/editbooks.py index f2e52af4..105995f6 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -405,7 +405,7 @@ def edit_book_languages(languages, book, upload=False): # the book it's language is set to the filter language if input_l[0] != current_user.filter_language() and current_user.filter_language() != "all": input_l[0] = calibre_db.session.query(db.Languages). \ - filter(db.Languages.lang_code == current_user.filter_language()).first() + filter(db.Languages.lang_code == current_user.filter_language()).first().lang_code # Remove duplicates input_l = helper.uniq(input_l) return modify_database_object(input_l, book.languages, db.Languages, calibre_db.session, 'languages') diff --git a/cps/templates/admin.html b/cps/templates/admin.html index b19dc235..a9ceefdf 100644 --- a/cps/templates/admin.html +++ b/cps/templates/admin.html @@ -88,7 +88,7 @@
{{_('Port')}}
{{config.config_port}}
- {% if feature_support['kobo'] and config.config_port != config.config_external_port %} + {% if kobo_support and config.config_port != config.config_external_port %}
{{_('External Port')}}
{{config.config_external_port}}