Skip to content

Commit ad72850

Browse files
committed
Omit _commit from saved input and overwrite ScriptForm default_renderer to revert hack introduced in core netbox
1 parent 64582b4 commit ad72850

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

netbox_script_manager/forms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ class ScriptExecutionFilterForm(SavedFiltersMixin, FilterForm):
8787

8888

8989
class ScriptForm(BootstrapMixin, forms.Form):
90+
default_renderer = forms.renderers.DjangoTemplates()
91+
9092
_commit = forms.BooleanField(
9193
required=False, initial=True, label=_("Commit changes"), help_text=_("Commit changes to the database (uncheck for a dry-run)")
9294
)

netbox_script_manager/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
GIT_TIMEOUT = 5
1616

1717
# Fields not included when saving script input
18-
EXCLUDED_POST_FIELDS = ["csrfmiddlewaretoken", "_schedule_at", "_interval", "_run"]
18+
EXCLUDED_POST_FIELDS = ["csrfmiddlewaretoken", "_schedule_at", "_interval", "_run", "_commit"]
1919

2020
# Name of the subpackage where custom scripts are stored
2121
CUSTOM_SCRIPT_SUBPACKAGE = "customscripts"

0 commit comments

Comments
 (0)