mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 12:12:53 -06:00
Add commit test in job execution
This commit is contained in:
parent
d3a9a6827f
commit
ed6ccfb723
@ -100,7 +100,10 @@ class ScriptJob(JobRunner):
|
|||||||
|
|
||||||
# Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process
|
# Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process
|
||||||
# change logging, event rules, etc.
|
# change logging, event rules, etc.
|
||||||
|
if commit:
|
||||||
with ExitStack() as stack:
|
with ExitStack() as stack:
|
||||||
for request_processor in registry['request_processors']:
|
for request_processor in registry['request_processors']:
|
||||||
stack.enter_context(request_processor(request))
|
stack.enter_context(request_processor(request))
|
||||||
self.run_script(script, request, data, commit)
|
self.run_script(script, request, data, commit)
|
||||||
|
else:
|
||||||
|
self.run_script(script, request, data, commit)
|
||||||
|
Loading…
Reference in New Issue
Block a user