Save old JobResults

This commit is contained in:
kkthxbye
2022-03-24 13:42:07 +01:00
committed by jeremystretch
parent 8781d03aa7
commit f13a00b2dd
6 changed files with 6 additions and 40 deletions

View File

@@ -481,15 +481,6 @@ def run_script(data, request, commit=True, *args, **kwargs):
else:
_run_script()
# Delete any previous terminal state results
JobResult.objects.filter(
obj_type=job_result.obj_type,
name=job_result.name,
status__in=JobResultStatusChoices.TERMINAL_STATE_CHOICES
).exclude(
pk=job_result.pk
).delete()
def get_scripts(use_names=False):
"""
@@ -497,7 +488,7 @@ def get_scripts(use_names=False):
defined name in place of the actual module name.
"""
scripts = OrderedDict()
# Iterate through all modules within the reports path. These are the user-created files in which reports are
# Iterate through all modules within the scripts path. These are the user-created files in which reports are
# defined.
for importer, module_name, _ in pkgutil.iter_modules([settings.SCRIPTS_ROOT]):
# Remove cached module to ensure consistency with filesystem