Skip to content

Commit

Permalink
Merge pull request #81 from dbca-wa/upgrade/ckan-2.10
Browse files Browse the repository at this point in the history
Upgrade/ckan 2.10
  • Loading branch information
Zharktas authored Apr 15, 2024
2 parents 162d609 + 236a7e0 commit e4abd1e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
19 changes: 13 additions & 6 deletions ckanext/qa/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def update_config(self, config):
toolkit.add_template_directory(config, '../templates')

# check for qsv config
qsv_config = config.get('ckanext.qa.qsv_config')
if not qsv_config:
log.error('ckanext.qa.qsv_config not set')
if qsv_config:
qsv_path = Path(qsv_config)
qsv_bin = config.get('ckanext.qa.qsv_bin')
if qsv_bin:
qsv_path = Path(qsv_bin)
if not qsv_path.is_file():
log.error('ckanext.qa.qsv_config file not found: %s', qsv_path)
log.error('ckanext.qa.qsv_bin file not found: %s', qsv_path)
else:
log.error('ckanext.qa.qsv_bin not set')

# IPipe

Expand Down Expand Up @@ -121,3 +121,10 @@ def after_dataset_show(self, context, pkg_dict):
del qa_dict['package_id']
del qa_dict['resource_id']
res['qa'] = qa_dict

def before_dataset_index(self, pkg_dict):
'''
remove `qa` from index
'''
pkg_dict.pop('qa', None)
return pkg_dict
3 changes: 2 additions & 1 deletion test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ port = 5000


[app:main]
use = config:../ckan/test-core.ini
use = config:../../src/ckan/test-core.ini
ckan.site_id = test.ckan.net
ckan.plugins = qa archiver report
ckanext.qa.qsv_bin = qsv

Expand Down

0 comments on commit e4abd1e

Please sign in to comment.