From aa14d12f424147d55d9d728dc7752f85bdecaae3 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 25 Jul 2017 13:35:53 -0400 Subject: [PATCH] show just id field for API browser POST box --- awx/api/generics.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/awx/api/generics.py b/awx/api/generics.py index 654457ef45..d2d7f0ff40 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -627,6 +627,13 @@ class SubListAttachDetachAPIView(SubListCreateAttachDetachAPIView): status=status.HTTP_400_BAD_REQUEST) return super(SubListAttachDetachAPIView, self).post(request, *args, **kwargs) + def update_raw_data(self, data): + request_method = getattr(self, '_raw_data_request_method', None) + response_status = getattr(self, '_raw_data_response_status', 0) + if request_method == 'POST' and response_status in xrange(400, 500): + return super(SubListAttachDetachAPIView, self).update_raw_data(data) + return {'id': None} + class DeleteLastUnattachLabelMixin(object): '''