Pass user data to ravenjs
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 30 Dec 2013 15:18:16 +0000 (16:18 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 12 Aug 2014 09:47:12 +0000 (11:47 +0200)
apps/wiki/templates/wiki/bootstrap.html

index 1e3fa58..712b9fb 100644 (file)
@@ -8,6 +8,13 @@
             <script src="http://cdn.ravenjs.com/1.1.3/jquery,native/raven.min.js"></script>
             <script>
                 Raven.config('{{RAVEN_CONFIG.SENTRY_URL}}', {{RAVEN_CONFIG.SETTINGS|default:'{}'}}).install();
             <script src="http://cdn.ravenjs.com/1.1.3/jquery,native/raven.min.js"></script>
             <script>
                 Raven.config('{{RAVEN_CONFIG.SENTRY_URL}}', {{RAVEN_CONFIG.SETTINGS|default:'{}'}}).install();
+                {% if request.user %}
+                    Raven.setUser({
+                        name: '{{request.user.username}}',
+                        email: '{{request.user.email}}',
+                        id: {{request.user.id}}
+                    });
+                {% endif %}
             </script>
         {% endif %}
         <script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
             </script>
         {% endif %}
         <script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>