mirror of
https://github.com/ansible/awx.git
synced 2026-03-14 15:37:29 -02:30
delete orphaned labels when jt or j deleted
This commit is contained in:
@@ -449,8 +449,10 @@ class DeleteLastUnattachLabelMixin(object):
|
||||
|
||||
res = super(DeleteLastUnattachLabelMixin, self).unattach_by_id(request, sub_id)
|
||||
|
||||
if Label.is_detached(sub_id):
|
||||
Label.objects.get(id=sub_id).delete()
|
||||
label = Label.objects.get(id=sub_id)
|
||||
|
||||
if label.is_detached():
|
||||
label.delete()
|
||||
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user