From 29702400f12ec01b9f5d49c3ddde05dac7fe62a6 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Fri, 22 Apr 2022 09:07:03 -0400 Subject: [PATCH] Avoid parent instance update when status was unchanged --- awx/main/models/unified_jobs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 63a5e2588a..d3a1286c81 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -813,7 +813,8 @@ class UnifiedJob( # If this job already exists in the database, retrieve a copy of # the job in its prior state. - if self.pk: + # If update_fields are given without status, then that indicates no change + if self.pk and ((not update_fields) or ('status' in update_fields)): self_before = self.__class__.objects.get(pk=self.pk) if self_before.status != self.status: status_before = self_before.status