Commit f4122bbc authored by Sli's avatar Sli

sentry: deal with sentry's js as external resource

parent bdd84277
Pipeline #1557 passed with stage
in 7 minutes and 59 seconds
This diff is collapsed.
{% extends "core/base.jinja" %} {% extends "core/base.jinja" %}
{% block head %} {% block head %}
{{ super() }} {{ super() }}
<script src="https://browser.sentry-cdn.com/4.0.6/bundle.min.js" crossorigin="anonymous"></script> {% if settings.EXTERNAL_RES %}
<script src="https://browser.sentry-cdn.com/4.0.6/bundle.min.js" crossorigin="anonymous"></script>
{% else %}
<script src="{{ static('core/js/sentry/bundle.min.js') }}" crossorigin="anonymous"></script>
{% endif %}
{% endblock head %} {% endblock head %}
{% block content %} {% block content %}
<h3>{% trans %}500, Server Error{% endtrans %}</h3> <h3>{% trans %}500, Server Error{% endtrans %}</h3>
{% if request.sentry_dsn %} {% if settings.SENTRY_DSN %}
<script> <script>
Sentry.init({ dsn: '{{ request.sentry_dsn }}' }); Sentry.init({ dsn: '{{ request.sentry_dsn }}' });
Sentry.showReportDialog({ eventId: '{{ request.sentry_last_event_id() }}' }) Sentry.showReportDialog({ eventId: '{{ request.sentry_last_event_id() }}' })
......
...@@ -72,7 +72,6 @@ def not_found(request): ...@@ -72,7 +72,6 @@ def not_found(request):
def internal_servor_error(request): def internal_servor_error(request):
request.sentry_dsn = settings.SENTRY_DSN
request.sentry_last_event_id = last_event_id request.sentry_last_event_id = last_event_id
return HttpResponseServerError(render(request, "core/500.jinja")) return HttpResponseServerError(render(request, "core/500.jinja"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment