1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

PR review updates

This commit is contained in:
John Anderson
2020-07-03 11:55:04 -04:00
parent f98fa364c0
commit f092c107b5
17 changed files with 178 additions and 123 deletions

View File

@@ -399,10 +399,6 @@ def run_script(data, request, commit=True, *args, **kwargs):
A wrapper for calling Script.run(). This performs error handling and provides a hook for committing changes. It
exists outside of the Script class to ensure it cannot be overridden by a script author.
"""
output = None
start_time = None
end_time = None
job_result = kwargs.pop('job_result')
module, script_name = job_result.name.split('.', 1)
@@ -463,7 +459,7 @@ def run_script(data, request, commit=True, *args, **kwargs):
JobResult.objects.filter(
obj_type=job_result.obj_type,
name=job_result.name,
status=JobResultStatusChoices.TERMINAL_STATE_CHOICES
status__in=JobResultStatusChoices.TERMINAL_STATE_CHOICES
).exclude(
pk=job_result.pk
).delete()