mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 13:55:31 +03:00
Merge pull request #46 from chrismeyersfsu/fix-child_parent_status_propogation
did not previously translate project update parent instance correctly
This commit is contained in:
commit
10f222e48f
@ -364,7 +364,9 @@ class ProjectUpdate(UnifiedJob, ProjectOptions):
|
||||
parent_instance = self._get_parent_instance()
|
||||
if parent_instance:
|
||||
update_fields = self._update_parent_instance_no_save(parent_instance)
|
||||
if not self.failed and parent_instance.scm_delete_on_next_update:
|
||||
parent_instance.scm_delete_on_next_update = False
|
||||
update_fields.append('scm_delete_on_next_update')
|
||||
parent_instance.save(update_fields=update_fields)
|
||||
if self.status in ('successful', 'failed', 'error', 'canceled'):
|
||||
if not self.failed and parent_instance.scm_delete_on_next_update:
|
||||
parent_instance.scm_delete_on_next_update = False
|
||||
if 'scm_delete_on_next_update' not in update_fields:
|
||||
update_fields.append('scm_delete_on_next_update')
|
||||
parent_instance.save(update_fields=update_fields)
|
||||
|
@ -480,7 +480,8 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
|
||||
def _update_parent_instance_no_save(self, parent_instance, update_fields=[]):
|
||||
def parent_instance_set(key, val):
|
||||
setattr(parent_instance, key, val)
|
||||
update_fields.append(key)
|
||||
if key not in update_fields:
|
||||
update_fields.append(key)
|
||||
|
||||
if parent_instance:
|
||||
if self.status in ('pending', 'waiting', 'running'):
|
||||
|
Loading…
Reference in New Issue
Block a user