mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-20 10:36:13 +00:00
Piwik: Simply ignore link materials with empty URL
This commit is contained in:
parent
44acb37507
commit
2a75be9b1f
@ -95,6 +95,9 @@ class PiwikPlugin(IndicoPlugin):
|
||||
def track_download(self, event, resource, **kwargs):
|
||||
tracker = PiwikQueryTrackDownload()
|
||||
resource_url = request.url if isinstance(resource, LocalFile) else resource.getURL()
|
||||
if not resource_url:
|
||||
# Some very old events apparently have link resources with an empty URL
|
||||
return
|
||||
resource_title = resource.getFileName() if isinstance(resource, LocalFile) else resource.getURL()
|
||||
resource_title = 'Download - {}'.format(resource_title)
|
||||
tracker.call(resource_url, resource_title)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user