mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-20 16:01:34 +02:00
Add debug field to ConfigTemplate and (if True) render template errors with a full traceback.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user