From f543d7f486c3bca6f2f257ed6d053b955baae466 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Tue, 20 Aug 2019 18:32:04 +0200 Subject: [PATCH] Fix #1016 --- cps/__init__.py | 6 ++++-- cps/about.py | 2 +- cps/admin.py | 8 +++++--- cps/services/__init__.py | 2 +- cps/services/{goodreads.py => goodreads_support.py} | 0 cps/web.py | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) rename cps/services/{goodreads.py => goodreads_support.py} (100%) diff --git a/cps/__init__.py b/cps/__init__.py index d26c3cdc..72a359f7 100755 --- a/cps/__init__.py +++ b/cps/__init__.py @@ -100,8 +100,10 @@ def create_app(): if services.ldap: services.ldap.init_app(app, config) - if services.goodreads: - services.goodreads.connect(config.config_goodreads_api_key, config.config_goodreads_api_secret, config.config_use_goodreads) + if services.goodreads_support: + services.goodreads_support.connect(config.config_goodreads_api_key, + config.config_goodreads_api_secret, + config.config_use_goodreads) return app diff --git a/cps/about.py b/cps/about.py index a54754c7..8d0a938f 100644 --- a/cps/about.py +++ b/cps/about.py @@ -63,7 +63,7 @@ _VERSIONS = OrderedDict( pytz=pytz.__version__, Unidecode = unidecode_version, Flask_SimpleLDAP = _(u'installed') if bool(services.ldap) else _(u'not installed'), - Goodreads = _(u'installed') if bool(services.goodreads) else _(u'not installed'), + Goodreads = _(u'installed') if bool(services.goodreads_support) else _(u'not installed'), ) _VERSIONS.update(uploader.get_versions()) diff --git a/cps/admin.py b/cps/admin.py index b6dcf66a..ccb07d84 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -46,7 +46,7 @@ from .web import admin_required, render_title_template, before_request, unconfig feature_support = { 'ldap': False, # bool(services.ldap), - 'goodreads': bool(services.goodreads) + 'goodreads': bool(services.goodreads_support) } # try: @@ -338,8 +338,10 @@ def _configuration_update_helper(): _config_checkbox("config_use_goodreads") _config_string("config_goodreads_api_key") _config_string("config_goodreads_api_secret") - if services.goodreads: - services.goodreads.connect(config.config_goodreads_api_key, config.config_goodreads_api_secret, config.config_use_goodreads) + if services.goodreads_support: + services.goodreads_support.connect(config.config_goodreads_api_key, + config.config_goodreads_api_secret, + config.config_use_goodreads) _config_int("config_updatechannel") diff --git a/cps/services/__init__.py b/cps/services/__init__.py index 032ffd0a..f77342bb 100644 --- a/cps/services/__init__.py +++ b/cps/services/__init__.py @@ -24,7 +24,7 @@ from .. import logger log = logger.create() -try: from . import goodreads +try: from . import goodreads_support except ImportError as err: log.debug("cannot import goodreads, showing authors-metadata will not work: %s", err) goodreads = None diff --git a/cps/services/goodreads.py b/cps/services/goodreads_support.py similarity index 100% rename from cps/services/goodreads.py rename to cps/services/goodreads_support.py diff --git a/cps/web.py b/cps/web.py index 15f0f976..17f67cea 100644 --- a/cps/web.py +++ b/cps/web.py @@ -55,7 +55,7 @@ from .redirect import redirect_back feature_support = { 'ldap': False, # bool(services.ldap), - 'goodreads': bool(services.goodreads) + 'goodreads': bool(services.goodreads_support) } try: