Skip to content

Commit

Permalink
[QOLDEV-915] fix integration with QA plugin
Browse files Browse the repository at this point in the history
- Previously we detected the QA plugin presence by checking for it in the config, but this has stopped working,
possibly as part of the CKAN 2.10 upgrade. Change it to instead attempt the necessary imports and rely on that.

NB This will cause ckanext-data-qld to implement the IQA interface if QA is installed but not enabled.
However, that should not be problematic, since the interface will simply do nothing if QA is not running.
  • Loading branch information
ThrawnCA committed Jul 15, 2024
1 parent 62d3f49 commit b0023c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckanext/data_qld/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
from .resource_freshness import validation as resource_freshness_validator
from .resource_freshness.logic.actions import get as resource_freshness_get_actions

if ' qa' in tk.config.get('ckan.plugins', ''):
try:
from ckanext.qa.interfaces import IQA
import ckanext.qa.lib as qa_lib
import ckanext.qa.tasks as qa_tasks
import os
qa_present = True
except ImportError:
qa_present = False


log = logging.getLogger(__name__)
Expand All @@ -43,7 +46,7 @@ class DataQldPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IBlueprint)
plugins.implements(plugins.IClick)

if ' qa' in tk.config.get('ckan.plugins', ''):
if qa_present:
plugins.implements(IQA)

# IConfigurer
Expand Down

0 comments on commit b0023c3

Please sign in to comment.