mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-18 22:11:49 -05:00
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