diff --git a/awx/api/serializers.py b/awx/api/serializers.py index f58a4af1c8..aea7ad0c7e 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -924,7 +924,6 @@ class ProjectSerializer(UnifiedJobTemplateSerializer, ProjectOptionsSerializer): def get_related(self, obj): res = super(ProjectSerializer, self).get_related(obj) res.update(dict( - organizations = reverse('api:project_organizations_list', args=(obj.pk,)), teams = reverse('api:project_teams_list', args=(obj.pk,)), playbooks = reverse('api:project_playbooks', args=(obj.pk,)), update = reverse('api:project_update_view', args=(obj.pk,)), @@ -936,6 +935,9 @@ class ProjectSerializer(UnifiedJobTemplateSerializer, ProjectOptionsSerializer): notifiers_error = reverse('api:project_notifiers_error_list', args=(obj.pk,)), access_list = reverse('api:project_access_list', args=(obj.pk,)), )) + if obj.organization: + res['organization'] = reverse('api:organization_detail', + args=(obj.organization.pk,)) # Backwards compatibility. if obj.current_update: res['current_update'] = reverse('api:project_update_detail', diff --git a/awx/api/urls.py b/awx/api/urls.py index 8b07352343..188cc95e63 100644 --- a/awx/api/urls.py +++ b/awx/api/urls.py @@ -44,7 +44,6 @@ project_urls = patterns('awx.api.views', url(r'^$', 'project_list'), url(r'^(?P[0-9]+)/$', 'project_detail'), url(r'^(?P[0-9]+)/playbooks/$', 'project_playbooks'), - url(r'^(?P[0-9]+)/organizations/$', 'project_organizations_list'), url(r'^(?P[0-9]+)/teams/$', 'project_teams_list'), url(r'^(?P[0-9]+)/update/$', 'project_update_view'), url(r'^(?P[0-9]+)/project_updates/$', 'project_updates_list'), diff --git a/awx/api/views.py b/awx/api/views.py index 04a7785cd3..4883342003 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -829,13 +829,6 @@ class ProjectPlaybooks(RetrieveAPIView): model = Project serializer_class = ProjectPlaybooksSerializer -class ProjectOrganizationsList(SubListCreateAttachDetachAPIView): - - model = Organization - serializer_class = OrganizationSerializer - parent_model = Project - relationship = 'organizations' - class ProjectTeamsList(SubListCreateAttachDetachAPIView): model = Team