Adding prevent_instance_group_fallback

This commit is contained in:
John Westcott IV
2022-08-23 14:13:06 -04:00
parent 87c65c9997
commit 0983bd8dc0
9 changed files with 308 additions and 269 deletions

View File

@@ -175,6 +175,13 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
related_name='inventory_labels',
help_text=_('Labels associated with this inventory.'),
)
prevent_instance_group_fallback = models.BooleanField(
default=False,
help_text=(
"If enabled, the job template will prevent adding any inventory or organization "
"instance groups to the list of preferred instances groups to run on."
),
)
def get_absolute_url(self, request=None):
return reverse('api:inventory_detail', kwargs={'pk': self.pk}, request=request)