mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 02:17:37 -02:30
fix adhoc IG bug and prevent related inventory deletion
This commit is contained in:
@@ -613,6 +613,8 @@ class InventoryAccess(BaseAccess):
|
||||
for o in Job.objects.filter(inventory=obj, status__in=ACTIVE_STATES)])
|
||||
active_jobs.extend([dict(type="inventory_update", id=o.id)
|
||||
for o in InventoryUpdate.objects.filter(inventory_source__inventory=obj, status__in=ACTIVE_STATES)])
|
||||
active_jobs.extend([dict(type="ad_hoc_command", id=o.id)
|
||||
for o in AdHocCommand.objects.filter(inventory=obj, status__in=ACTIVE_STATES)])
|
||||
if len(active_jobs) > 0:
|
||||
raise StateConflict({"conflict": _("Resource is being used by running jobs"),
|
||||
"active_jobs": active_jobs})
|
||||
|
||||
Reference in New Issue
Block a user