Merge pull request #3686 from vismay-golwala/instance_group_delete

[WIP] Disallow deleting controller or isolated instance groups

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-04-24 15:19:19 +00:00
committed by GitHub
4 changed files with 39 additions and 2 deletions

View File

@@ -209,6 +209,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
'''