mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 13:25:02 -02:30
Disallow deleting controller or isolated instance groups
Added two new properties to the InstanceGroup model - `is_controller` and `is_isolated`. Used these properties to hide the trash icon for instance groups that are either controller or isolated. Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
This commit is contained in:
@@ -208,6 +208,14 @@ class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin):
|
||||
def jobs_total(self):
|
||||
return UnifiedJob.objects.filter(instance_group=self).count()
|
||||
|
||||
@property
|
||||
def is_controller(self):
|
||||
return self.controlled_groups.exists()
|
||||
|
||||
@property
|
||||
def is_isolated(self):
|
||||
return bool(self.controller)
|
||||
|
||||
'''
|
||||
RelatedJobsMixin
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user