mirror of
https://github.com/ansible/awx.git
synced 2026-04-10 12:39:22 -02:30
Merge pull request #1675 from wwitzel3/fix-879
Bulk update host field to null for JobEvents
This commit is contained in:
@@ -548,6 +548,8 @@ def delete_inventory(self, inventory_id, user_id):
|
|||||||
with ignore_inventory_computed_fields(), ignore_inventory_group_removal(), impersonate(user):
|
with ignore_inventory_computed_fields(), ignore_inventory_group_removal(), impersonate(user):
|
||||||
try:
|
try:
|
||||||
i = Inventory.objects.get(id=inventory_id)
|
i = Inventory.objects.get(id=inventory_id)
|
||||||
|
for host in i.hosts.iterator():
|
||||||
|
host.job_events_as_primary_host.update(host=None)
|
||||||
i.delete()
|
i.delete()
|
||||||
emit_channel_notification(
|
emit_channel_notification(
|
||||||
'inventories-status_changed',
|
'inventories-status_changed',
|
||||||
|
|||||||
Reference in New Issue
Block a user