From 8964f48879483d47cde7b74580c60b22b7511685 Mon Sep 17 00:00:00 2001 From: Augusto Herrmann Date: Wed, 2 Apr 2014 16:47:59 -0300 Subject: [PATCH 1/2] fix #5 (global name 'Authorizer' is not defined) --- ckanext/googleanalytics/dbutil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ckanext/googleanalytics/dbutil.py b/ckanext/googleanalytics/dbutil.py index 5029191..f78219f 100644 --- a/ckanext/googleanalytics/dbutil.py +++ b/ckanext/googleanalytics/dbutil.py @@ -80,8 +80,9 @@ def get_resource_visits_for_url(url): def get_top_packages(limit=20): items = [] authorizer = Authorizer() - q = authorizer.authorized_query(PSEUDO_USER__VISITOR, - model.Package) + # caveat emptor: the query below will not filter out private + # or deleted datasets (TODO) + q = model.Session.query(model.Package) connection = model.Session.connection() package_stats = get_table('package_stats') s = select([package_stats.c.package_id, From dc31c3768337e2aa14c1c5eb7c2cccdbd96a10b9 Mon Sep 17 00:00:00 2001 From: Augusto Herrmann Date: Tue, 21 Aug 2018 09:26:13 -0300 Subject: [PATCH 2/2] remove instantiation of deprecated class that wasn't used anyway --- ckanext/googleanalytics/dbutil.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ckanext/googleanalytics/dbutil.py b/ckanext/googleanalytics/dbutil.py index f78219f..1aba9b6 100644 --- a/ckanext/googleanalytics/dbutil.py +++ b/ckanext/googleanalytics/dbutil.py @@ -79,7 +79,6 @@ def get_resource_visits_for_url(url): def get_top_packages(limit=20): items = [] - authorizer = Authorizer() # caveat emptor: the query below will not filter out private # or deleted datasets (TODO) q = model.Session.query(model.Package)