mirror of
https://github.com/ansible/awx.git
synced 2026-06-27 17:38:02 -02:30
Change PeersSerializer to SlugRelatedField
Get rid of PeersSerializer and just use SlugRelatedField, which should be more a straightforward approach. Other changes: - cleanup code related to the already-removed api/v2/peers endpoint - add "hybrid" node type into more instance_peers test cases
This commit is contained in:
@@ -39,7 +39,6 @@ from awx.main.models import (
|
||||
Host,
|
||||
Instance,
|
||||
InstanceGroup,
|
||||
InstanceLink,
|
||||
Inventory,
|
||||
InventorySource,
|
||||
InventoryUpdate,
|
||||
@@ -2950,22 +2949,6 @@ class WorkflowApprovalTemplateAccess(BaseAccess):
|
||||
return self.model.objects.filter(workflowjobtemplatenodes__workflow_job_template__in=WorkflowJobTemplate.accessible_pk_qs(self.user, 'read_role'))
|
||||
|
||||
|
||||
class PeersAccess(BaseAccess):
|
||||
model = InstanceLink
|
||||
|
||||
def can_add(self, data):
|
||||
return False
|
||||
|
||||
def can_change(self, obj, data):
|
||||
return False
|
||||
|
||||
def can_delete(self, obj):
|
||||
return True
|
||||
|
||||
def can_copy(self, obj):
|
||||
return False
|
||||
|
||||
|
||||
for cls in BaseAccess.__subclasses__():
|
||||
access_registry[cls.model] = cls
|
||||
access_registry[UnpartitionedJobEvent] = UnpartitionedJobEventAccess
|
||||
|
||||
Reference in New Issue
Block a user