#16 / ga works with default uploader

This commit is contained in:
Gleb 2017-02-14 10:04:34 +02:00
parent 1165fdf22f
commit b7238dc8c8
2 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,6 @@ from webob.multidict import UnicodeMultiDict
from paste.util.multidict import MultiDict from paste.util.multidict import MultiDict
from ckan.controllers.api import ApiController from ckan.controllers.api import ApiController
from ckan.controllers.package import PackageController
log = logging.getLogger('ckanext.googleanalytics') log = logging.getLogger('ckanext.googleanalytics')

View File

@ -11,6 +11,7 @@ import ckan.plugins as p
import gasnippet import gasnippet
from routes.mapper import SubMapper, Mapper as _Mapper from routes.mapper import SubMapper, Mapper as _Mapper
from pylons import config from pylons import config
from ckan.controllers.package import PackageController
import urllib2 import urllib2
import importlib import importlib
@ -254,3 +255,7 @@ class GoogleAnalyticsPlugin(p.SingletonPlugin):
controller_class = getattr(module, route_controller[1]) controller_class = getattr(module, route_controller[1])
controller_class.resource_download = post_analytics_decorator( controller_class.resource_download = post_analytics_decorator(
controller_class.resource_download) controller_class.resource_download)
else:
# If no custom uploader applied, use the default one
PackageController.resource_download = post_analytics_decorator(
PackageController.resource_download)