mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
Add more 'auto-associate by posting new object' end points.
This commit is contained in:
@@ -207,4 +207,8 @@ class UsersTest(BaseTest):
|
|||||||
data = self.get(url, expect=200, auth=self.get_normal_credentials())
|
data = self.get(url, expect=200, auth=self.get_normal_credentials())
|
||||||
self.assertEquals(data['count'], 0)
|
self.assertEquals(data['count'], 0)
|
||||||
|
|
||||||
|
# FIXME: add test that shows posting a user w/o id to /organizations/2/users/ can create a new one & associate
|
||||||
|
# FIXME: add test that shows posting a user w/o id to /organizations/2/admins/ can create a new one & associate
|
||||||
|
# FIXME: add test that shows posting a projects w/o id to /organizations/2/projects/ can create a new one & associate
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class OrganizationsUsersList(BaseSubList):
|
|||||||
parent_model = Organization
|
parent_model = Organization
|
||||||
relationship = 'users'
|
relationship = 'users'
|
||||||
postable = True
|
postable = True
|
||||||
|
inject_primary_key_on_post_as = 'organization'
|
||||||
|
|
||||||
def _get_queryset(self):
|
def _get_queryset(self):
|
||||||
''' to list users in the organization, I must be a superuser or org admin '''
|
''' to list users in the organization, I must be a superuser or org admin '''
|
||||||
@@ -101,6 +102,7 @@ class OrganizationsAdminsList(BaseSubList):
|
|||||||
parent_model = Organization
|
parent_model = Organization
|
||||||
relationship = 'admins'
|
relationship = 'admins'
|
||||||
postable = True
|
postable = True
|
||||||
|
inject_primary_key_on_post_as = 'organization'
|
||||||
|
|
||||||
def _get_queryset(self):
|
def _get_queryset(self):
|
||||||
''' to list admins in the organization, I must be a superuser or org admin '''
|
''' to list admins in the organization, I must be a superuser or org admin '''
|
||||||
@@ -117,6 +119,7 @@ class OrganizationsProjectsList(BaseSubList):
|
|||||||
parent_model = Organization # for sub list
|
parent_model = Organization # for sub list
|
||||||
relationship = 'projects' # " "
|
relationship = 'projects' # " "
|
||||||
postable = True
|
postable = True
|
||||||
|
inject_primary_key_on_post_as = 'organization'
|
||||||
|
|
||||||
def _get_queryset(self):
|
def _get_queryset(self):
|
||||||
''' to list projects in the organization, I must be a superuser or org admin '''
|
''' to list projects in the organization, I must be a superuser or org admin '''
|
||||||
@@ -133,6 +136,7 @@ class OrganizationsTagsList(BaseSubList):
|
|||||||
parent_model = Organization # for sub list
|
parent_model = Organization # for sub list
|
||||||
relationship = 'tags' # " "
|
relationship = 'tags' # " "
|
||||||
postable = True
|
postable = True
|
||||||
|
inject_primary_key_on_post_as = 'organization'
|
||||||
|
|
||||||
def _get_queryset(self):
|
def _get_queryset(self):
|
||||||
''' to list tags in the organization, I must be a superuser or org admin '''
|
''' to list tags in the organization, I must be a superuser or org admin '''
|
||||||
|
|||||||
Reference in New Issue
Block a user