mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 03:59:21 -02:30
delete label on last disassociate
This commit is contained in:
@@ -39,3 +39,13 @@ class Label(CommonModelNameNotUnique):
|
||||
jobtemplate_labels__isnull=True
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def is_detached(id):
|
||||
return bool(
|
||||
Label.objects.filter(
|
||||
id=id,
|
||||
unifiedjob_labels__isnull=True,
|
||||
unifiedjobtemplate_labels__isnull=True
|
||||
).count())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user