return klass
else:
return wrap
+
+
+def piwik_track_view(view):
+ if not getattr(settings, 'PIWIK_SITE_ID', 0):
+ return view
+
+ def wrap(request, *args, **kwargs):
+ if getattr(request, 'piwik_track', True):
+ track_request.delay(piwik_url(request))
+ return view(request, *args, **kwargs)
+
+ update_wrapper(wrap, view)
+ return wrap