mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 19:21:06 -03:30
Test that you can't post to an audit trail collection (ever), and a switch to control postability to sub lists.
This commit is contained in:
@@ -51,6 +51,10 @@ class BaseSubList(BaseList):
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
||||
postable = getattr(self.__class__, 'postable', False)
|
||||
if not postable:
|
||||
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||
|
||||
parent_id = kwargs['pk']
|
||||
sub_id = request.DATA.get('id')
|
||||
main = self.__class__.parent_model.objects.get(pk=parent_id)
|
||||
|
||||
Reference in New Issue
Block a user