From a5eda594b6e468a665534f26e5ae556713253d67 Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Fri, 10 Jul 2015 10:45:29 +0200 Subject: [PATCH] Piwik: Honor the enabled_for_downloads setting --- piwik/indico_piwik/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/piwik/indico_piwik/plugin.py b/piwik/indico_piwik/plugin.py index 41fea82..59b7201 100644 --- a/piwik/indico_piwik/plugin.py +++ b/piwik/indico_piwik/plugin.py @@ -95,6 +95,8 @@ class PiwikPlugin(IndicoPlugin): self.register_css_bundle('jqtree_css', 'js/lib/jqTree/jqtree.css') def track_download(self, attachment, user, **kwargs): + if not self.settings.get('enabled_for_downloads'): + return if attachment.type == AttachmentType.link: resource_url = attachment.link_url resource_title = 'Link - {0.title}'.format(attachment)