Fixes #5012: Return details of exceptions resulting from report/script execution

This commit is contained in:
Jeremy Stretch
2020-08-20 12:47:26 -04:00
parent bf4fee1592
commit bc0e6cc8dd
6 changed files with 33 additions and 39 deletions

View File

@@ -652,15 +652,13 @@ class JobResult(models.Model):
def set_status(self, status):
"""
Helper method to change the status of the job result and save. If the target status is terminal, the
completion time is also set.
Helper method to change the status of the job result. If the target status is terminal, the completion
time is also set.
"""
self.status = status
if status in JobResultStatusChoices.TERMINAL_STATE_CHOICES:
self.completed = timezone.now()
self.save()
@classmethod
def enqueue_job(cls, func, name, obj_type, user, *args, **kwargs):
"""