aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/templates
diff options
context:
space:
mode:
authorRob Hudson2009-08-28 09:13:37 -0700
committerRob Hudson2009-08-28 09:13:37 -0700
commit4a59813e75d7cb3b88bf2b223b21d4e23d9ecb03 (patch)
treeb75b614c0eabc980cb72e3164adca6b08f3fc72d /debug_toolbar/templates
parent0e5e71db6e1de7210aa9a546698942bfcdc98c73 (diff)
downloaddjango-debug-toolbar-4a59813e75d7cb3b88bf2b223b21d4e23d9ecb03.tar.bz2
Fixed sql profiling so it doesn't return a 500 if the SQL `SET PROFILING=1` results in an error. Also fixed view to render the correct template.
Diffstat (limited to 'debug_toolbar/templates')
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql_profile.html51
1 files changed, 29 insertions, 22 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
index 7df65da..0dcb0b9 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html
@@ -4,28 +4,35 @@
<h3>SQL Profiled</h3>
</div>
<div class="djDebugPanelContent">
- <dl>
- <dt>{% trans "Executed SQL" %}</dt>
- <dd><pre>{{ sql|safe }}</pre></dd>
- <dt>{% trans "Time" %}</dt>
- <dd>{{ time }} ms</dd>
- </dl>
- <table>
- <thead>
- <tr>
- {% for h in headers %}
- <th>{{ h|upper }}</th>
- {% endfor %}
- </tr>
- </thead>
- <tbody>
- {% for row in result %}
- <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
- {% for column in row %}
- <td>{{ column|escape }}</td>
+ {% if result %}
+ <dl>
+ <dt>{% trans "Executed SQL" %}</dt>
+ <dd><pre>{{ sql|safe }}</pre></dd>
+ <dt>{% trans "Time" %}</dt>
+ <dd>{{ time }} ms</dd>
+ </dl>
+ <table>
+ <thead>
+ <tr>
+ {% for h in headers %}
+ <th>{{ h|upper }}</th>
{% endfor %}
</tr>
- {% endfor %}
- </tbody>
- </table>
+ </thead>
+ <tbody>
+ {% for row in result %}
+ <tr class="{% cycle 'djDebugOdd' 'djDebugEven' %}">
+ {% for column in row %}
+ <td>{{ column|escape }}</td>
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ <dl>
+ <dt>{% trans 'Error' %}</dt>
+ <dd>{{ result_error }}</dd>
+ </dl>
+ {% endif %}
</div>