Skip to content

Commit

Permalink
Merge pull request arachnys#332 from imnotjames/safe-raw-data
Browse files Browse the repository at this point in the history
safely handle assigning "json" raw_data from results
  • Loading branch information
dbuxton committed Mar 31, 2016
2 parents fa61497 + 7b8c1df commit d8a54fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cabot/templates/cabotapp/statuscheckresult_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ <h2>Check result: <a href="{% url "check" result.check.id %}">{{ result.check.na
{% load compress %}
{{ block.super }}
<script type="text/javascript">
window.DATA = {{ result.raw_data|safe }};
try {
window.DATA = JSON.parse("{{ result.raw_data|escapejs }}");
} catch (e) {
window.DATA = {};
}
</script>
{% compress js %}
<script type="text/javascript" src="{{ STATIC_URL }}arachnys/js/raphael.js"></script>
Expand Down

0 comments on commit d8a54fd

Please sign in to comment.