1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Updating AC-984... delay field computation until after the group has been removed

This commit is contained in:
Matthew Jones 2014-02-04 09:29:20 -05:00
parent 6d6ea293a4
commit e911bdc3da

View File

@ -357,12 +357,17 @@ class Group(CommonModelNameNotUnique):
When marking groups inactive, remove all associations to related
groups/hosts/inventory_sources.
'''
super(Group, self).mark_inactive(save=save)
self.inventory_source.mark_inactive(save=save)
self.inventory_sources.clear()
self.parents.clear()
self.children.clear()
self.hosts.clear()
from awx.main.signals import ignore_inventory_computed_fields
i = self.inventory
with ignore_inventory_computed_fields():
super(Group, self).mark_inactive(save=save)
self.inventory_source.mark_inactive(save=save)
self.inventory_sources.clear()
self.parents.clear()
self.children.clear()
self.hosts.clear()
i.update_computed_fields()
def update_computed_fields(self):
'''