mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 22:48:02 -03:30
Check data type on post for license
This commit is contained in:
parent
0d8a2a0d82
commit
457555265a
@ -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"]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user