Commits

Branko Vukelic committed d812a00

Fixed wrong logic for untracking superusers

Comments (0)

Files changed (2)

heap/context_processors.py

     is_super = request.user.is_authenticated() and request.user.is_superuser
     return dict(
         HEAP_APP_ID=settings.HEAP_APP_ID,
-        HEAP_USER_TRACKABLE=settings.HEAP_TRACK_SUPERUSER and is_super
+        HEAP_USER_UNTRACKABLE=(not settings.HEAP_TRACK_SUPERUSER) and is_super
     )

heap/templates/heap/script.html

-{% if HEAP_APP_ID and HEAP_USER_TRACKABLE %}
+{% if HEAP_APP_ID and not HEAP_USER_UNTRACKABLE %}
 <script type="text/javascript">
     var heap=heap||[];heap.load=function(a){window._heapid=a;var b=document.createElement("script");b.type="text/javascript",b.async=!0,b.src=("https:"===document.location.protocol?"https:":"http:")+"//d36lvucg9kzous.cloudfront.net";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c);var d=function(a){return function(){heap.push([a].concat(Array.prototype.slice.call(arguments,0)))}},e=["identify","track"];for(var f=0;f<e.length;f++)heap[e[f]]=d(e[f])};
     heap.load("{{ HEAP_APP_ID }}");