Skip to content

Commit e1e5142

Browse files
authored
Fixes #18965: Ensure script list run buttons respect scripts' commit_default option (#19013)
* Fixes #18965: Script list run buttons respect scripts' commit_default * Cleanup script .Meta access in template
1 parent 7d80a45 commit e1e5142

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

netbox/templates/extras/script_list.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h2 class="card-header" id="module{{ module.pk }}">
6363
</span>
6464
{% endif %}
6565
</td>
66-
<td>{{ script.python_class.Meta.description|markdown|placeholder }}</td>
66+
<td>{{ script.python_class.description|markdown|placeholder }}</td>
6767
{% if last_job %}
6868
<td>
6969
<a href="{% url 'extras:script_result' job_pk=last_job.pk %}">{{ last_job.created|isodatetime }}</a>
@@ -79,6 +79,9 @@ <h2 class="card-header" id="module{{ module.pk }}">
7979
{% if request.user|can_run:script and script.is_executable %}
8080
<div class="float-end d-print-none">
8181
<form action="{% url 'extras:script' script.pk %}" method="post">
82+
{% if script.python_class.commit_default %}
83+
<input type="checkbox" name="_commit" hidden checked>
84+
{% endif %}
8285
{% csrf_token %}
8386
<button type="submit" name="_run" class="btn btn-primary btn-sm">
8487
{% if last_job %}

0 commit comments

Comments
 (0)