mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -02:30
Check data type on post for license
This commit is contained in:
@@ -207,6 +207,8 @@ class ApiV1ConfigView(APIView):
|
||||
def post(self, request):
|
||||
if not request.user.is_superuser:
|
||||
return Response(None, status=status.HTTP_404_NOT_FOUND)
|
||||
if not type(request.DATA) == dict:
|
||||
return Response({"error": "Invalid license data"}, status=status.HTTP_400_BAD_REQUEST)
|
||||
if "eula_accepted" not in request.DATA:
|
||||
return Response({"error": "Missing 'eula_accepted' property"}, status=status.HTTP_400_BAD_REQUEST)
|
||||
if not request.DATA["eula_accepted"]:
|
||||
|
||||
Reference in New Issue
Block a user