Hide private datasets
--- a/ckanext/ga_report/controller.py
+++ b/ckanext/ga_report/controller.py
@@ -342,7 +342,8 @@
downloads += int(x.value)
else:
downloads = 'No data'
- top_packages.append((package, entry.pageviews, entry.visits, downloads))
+ if package.private == False:
+ top_packages.append((package, entry.pageviews, entry.visits, downloads))
else:
log.warning('Could not find package associated package')
--- a/ckanext/ga_report/helpers.py
+++ b/ckanext/ga_report/helpers.py
@@ -116,6 +116,10 @@
_log.warning("Package {0} is not active, it is {1}".format(p.name, p.state))
continue
+ if not p.private == False:
+ _log.warning("Package {0} is private {1}".format(p.name, p.state))
+ continue
+
if not p in datasets:
datasets[p] = {'views':0, 'visits': 0}