Skip to content

Commit

Permalink
Merge pull request #22 from GSA/skip_tracking_for_harvest_sources
Browse files Browse the repository at this point in the history
Stop search tracking info for harvest sources
  • Loading branch information
avdata99 committed Dec 1, 2020
2 parents 2a599a5 + 60e91d4 commit 58a32d7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ckanext/datagovcatalog/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ def get_helpers(self):

def before_view(self, pkg_dict):

if config.get('ckanext.datagovcatalog.add_packages_tracking_info', True):
# add tracking information.
# CKAN by default hide tracking info for datasets
pkg_dict = toolkit.get_action("package_show")({}, {
'include_tracking': True,
'id': pkg_dict['id']
})
# Add tracking information just for datasets
if pkg_dict.get('type', 'dataset') == 'dataset':
if config.get('ckanext.datagovcatalog.add_packages_tracking_info', True):
# add tracking information.
# CKAN by default hide tracking info for datasets
pkg_dict = toolkit.get_action("package_show")({}, {
'include_tracking': True,
'id': pkg_dict['id']
})
return pkg_dict

0 comments on commit 58a32d7

Please sign in to comment.