mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -06:00
introduce default_fieldset
This commit is contained in:
parent
f81fab1271
commit
c1088549ca
@ -352,6 +352,13 @@ class BaseScript:
|
|||||||
# Set initial "commit" checkbox state based on the script's Meta parameter
|
# Set initial "commit" checkbox state based on the script's Meta parameter
|
||||||
form.fields['_commit'].initial = getattr(self.Meta, 'commit_default', True)
|
form.fields['_commit'].initial = getattr(self.Meta, 'commit_default', True)
|
||||||
|
|
||||||
|
# Append the default fieldset if defined in the Meta class
|
||||||
|
default_fieldset = (('Script Execution Functions', ('_schedule_at', '_interval', '_commit')),)
|
||||||
|
if hasattr(self.Meta, 'fieldsets'):
|
||||||
|
self.Meta.fieldsets += default_fieldset
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
return form
|
return form
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
|
Loading…
Reference in New Issue
Block a user