Merge pull request #10716 from oweel/10392-return_404_ad_hoc_command_events

Return 404 for ad_hoc_command_events list api. Remove api endtpoint
This commit is contained in:
Shane McDonald 2021-07-23 17:35:57 -04:00 committed by GitHub
commit 41321d8ad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions

View File

@ -3,11 +3,10 @@
from django.conf.urls import url
from awx.api.views import AdHocCommandEventList, AdHocCommandEventDetail
from awx.api.views import AdHocCommandEventDetail
urls = [
url(r'^$', AdHocCommandEventList.as_view(), name='ad_hoc_command_event_list'),
url(r'^(?P<pk>[0-9]+)/$', AdHocCommandEventDetail.as_view(), name='ad_hoc_command_event_detail'),
]

View File

@ -3906,18 +3906,6 @@ class AdHocCommandRelaunch(GenericAPIView):
return Response(data, status=status.HTTP_201_CREATED, headers=headers)
class AdHocCommandEventList(NoTruncateMixin, ListAPIView):
model = models.AdHocCommandEvent
serializer_class = serializers.AdHocCommandEventSerializer
search_fields = ('stdout',)
def get_queryset(self):
adhoc = self.get_parent_object()
self.check_parent_access(adhoc)
return adhoc.get_event_queryset()
class AdHocCommandEventDetail(RetrieveAPIView):
model = models.AdHocCommandEvent