Skip to content

Commit

Permalink
Update to new sentry-js setup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolas committed Oct 12, 2024
1 parent c63fceb commit bec46cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
28 changes: 3 additions & 25 deletions quizcon/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- The above 2 meta tags *must* come first in the head; any other head content must come *after* these tags -->

{% include "ctlsettings/sentry_js.html" %}

{% block precss %}{% endblock %}
<!-- Bootstrap CSS -->
<!-- CSS only -->
Expand Down Expand Up @@ -162,31 +165,6 @@
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" crossorigin="anonymous"></script>

{% if SENTRY_PUBLIC_DSN %}
<script
src="https://browser.sentry-cdn.com/5.7.1/bundle.min.js"
integrity="sha384-KMv6bBTABABhv0NI+rVWly6PIRvdippFEgjpKyxUcpEmDWZTkDOiueL5xW+cztZZ"
crossorigin="anonymous"></script>

<script>
Sentry.init({
dsn: '{{ SENTRY_PUBLIC_DSN }}'
});

{% if user.is_anonymous %}
Sentry.setUser({
email: 'none',
id: 'anonymous'
});
{% else %}
Sentry.setUser({
email: '{{ user.email }}',
id: '{{ user.username }}'
});
{% endif %}
</script>
{% endif %}

{% block js %}{% endblock %}

{% if STAGING_ENV %}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ django-flatblocks==1.0.0
djangorestframework==3.15.2

django-storages==1.14.4
ctlsettings==0.3.6
ctlsettings==0.4.1

django-reversion==5.1.0
text_unidecode==1.3
Expand Down

0 comments on commit bec46cb

Please sign in to comment.