mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 05:17:36 -02:30
enforce a stable list order when attaching/detaching instance groups
This commit is contained in:
@@ -38,6 +38,7 @@ from awx.main.fields import (
|
||||
ImplicitRoleField,
|
||||
JSONBField,
|
||||
SmartFilterField,
|
||||
OrderedManyToManyField,
|
||||
)
|
||||
from awx.main.managers import HostManager
|
||||
from awx.main.models.base import (
|
||||
@@ -157,9 +158,10 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
|
||||
default=None,
|
||||
help_text=_('Filter that will be applied to the hosts of this inventory.'),
|
||||
)
|
||||
instance_groups = models.ManyToManyField(
|
||||
instance_groups = OrderedManyToManyField(
|
||||
'InstanceGroup',
|
||||
blank=True,
|
||||
through='InventoryInstanceGroupMembership',
|
||||
)
|
||||
admin_role = ImplicitRoleField(
|
||||
parent_role='organization.inventory_admin_role',
|
||||
|
||||
Reference in New Issue
Block a user