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
This commit is contained in:
Jason Novinger 2025-03-27 07:39:50 -05:00 committed by GitHub
parent 7d80a45bf8
commit e1e514251e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,7 +63,7 @@
</span>
{% endif %}
</td>
<td>{{ script.python_class.Meta.description|markdown|placeholder }}</td>
<td>{{ script.python_class.description|markdown|placeholder }}</td>
{% if last_job %}
<td>
<a href="{% url 'extras:script_result' job_pk=last_job.pk %}">{{ last_job.created|isodatetime }}</a>
@ -79,6 +79,9 @@
{% if request.user|can_run:script and script.is_executable %}
<div class="float-end d-print-none">
<form action="{% url 'extras:script' script.pk %}" method="post">
{% if script.python_class.commit_default %}
<input type="checkbox" name="_commit" hidden checked>
{% endif %}
{% csrf_token %}
<button type="submit" name="_run" class="btn btn-primary btn-sm">
{% if last_job %}