Avoid parent instance update when status was unchanged

This commit is contained in:
Alan Rominger 2022-04-22 09:07:03 -04:00
parent 44f0609314
commit 29702400f1
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -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