mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Merge pull request #2641 from anoek/2515
Don't update computed fields while mass group deleting until the end
This commit is contained in:
commit
7979ad3bc8
@ -221,6 +221,8 @@ def migrate_children_from_deleted_group_to_parent_groups(sender, **kwargs):
|
||||
parents_pks = getattr(instance, '_saved_parents_pks', [])
|
||||
hosts_pks = getattr(instance, '_saved_hosts_pks', [])
|
||||
children_pks = getattr(instance, '_saved_children_pks', [])
|
||||
is_updating = getattr(_inventory_updates, 'is_updating', False)
|
||||
|
||||
with ignore_inventory_group_removal():
|
||||
with ignore_inventory_computed_fields():
|
||||
if parents_pks:
|
||||
@ -234,7 +236,7 @@ def migrate_children_from_deleted_group_to_parent_groups(sender, **kwargs):
|
||||
child_group, parent_group)
|
||||
parent_group.children.add(child_group)
|
||||
inventory_pk = getattr(instance, '_saved_inventory_pk', None)
|
||||
if inventory_pk:
|
||||
if inventory_pk and not is_updating:
|
||||
try:
|
||||
inventory = Inventory.objects.get(pk=inventory_pk)
|
||||
inventory.update_computed_fields()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user