mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-17 22:49:59 +02:00
* Initial work on #19816 * Use TZ-aware timestamps * Deserialize JobLogEntry timestamp * Repurpose RQJobStatusColumn to display job entry level badges * Misc cleanup * Test logging * Refactor HTML templates * Update documentation
This commit is contained in:
@@ -90,7 +90,10 @@ class ScriptJob(JobRunner):
|
||||
request: The WSGI request associated with this execution (if any)
|
||||
commit: Passed through to Script.run()
|
||||
"""
|
||||
script = ScriptModel.objects.get(pk=self.job.object_id).python_class()
|
||||
script_model = ScriptModel.objects.get(pk=self.job.object_id)
|
||||
self.logger.debug(f"Found ScriptModel ID {script_model.pk}")
|
||||
script = script_model.python_class()
|
||||
self.logger.debug(f"Loaded script {script.full_name}")
|
||||
|
||||
# Add files to form data
|
||||
if request:
|
||||
@@ -100,6 +103,7 @@ class ScriptJob(JobRunner):
|
||||
|
||||
# Add the current request as a property of the script
|
||||
script.request = request
|
||||
self.logger.debug(f"Request ID: {request.id}")
|
||||
|
||||
# Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process
|
||||
# change logging, event rules, etc.
|
||||
|
||||
Reference in New Issue
Block a user