Fixes: #19953 - ConfigTemplate debug rendering mode (#21652)

Add debug field to ConfigTemplate and (if True) render template errors
with a full traceback.
This commit is contained in:
bctiemann
2026-03-13 03:19:45 -04:00
committed by GitHub
parent 02165a28a0
commit b01d92c98b
16 changed files with 155 additions and 21 deletions

View File

@@ -33,6 +33,10 @@
<th scope="row">{% trans "Attachment" %}</th>
<td>{% checkmark object.as_attachment %}</td>
</tr>
<tr>
<th scope="row">{% trans "Debug" %}</th>
<td>{% checkmark object.debug %}</td>
</tr>
<tr>
<th scope="row">{% trans "Data Source" %}</th>
<td>

View File

@@ -66,7 +66,13 @@
{% elif error_message %}
<div class="alert alert-warning">
<h4 class="alert-title mb-1">{% trans "Error rendering template" %}</h4>
{% trans error_message %}
{% if config_template.debug %}
<div class="overflow-auto" style="max-height: 30rem;">
<pre class="mb-0">{{ error_message }}</pre>
</div>
{% else %}
<pre class="mb-0 text-warning-emphasis bg-transparent border-0 p-0">{{ error_message }}</pre>
{% endif %}
</div>
{% else %}
<div class="alert alert-warning">