Przeglądaj źródła

fix previous job result deletion

John Anderson 5 lat temu
rodzic
commit
1d922a1848
2 zmienionych plików z 2 dodań i 0 usunięć
  1. 1 0
      netbox/extras/reports.py
  2. 1 0
      netbox/extras/scripts.py

+ 1 - 0
netbox/extras/reports.py

@@ -76,6 +76,7 @@ def run_report(job_result, *args, **kwargs):
     # Delete any previous terminal state results
     JobResult.objects.filter(
         obj_type=job_result.obj_type,
+        name=job_result.name,
         status=JobResultStatusChoices.TERMINAL_STATE_CHOICES
     ).exclude(
         pk=job_result.pk

+ 1 - 0
netbox/extras/scripts.py

@@ -462,6 +462,7 @@ def run_script(data, request, commit=True, *args, **kwargs):
     # Delete any previous terminal state results
     JobResult.objects.filter(
         obj_type=job_result.obj_type,
+        name=job_result.name,
         status=JobResultStatusChoices.TERMINAL_STATE_CHOICES
     ).exclude(
         pk=job_result.pk