diff --git a/awx/api/views.py b/awx/api/views.py index 1ffe8b1631..d3d6e7f3cf 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -3,6 +3,7 @@ # All Rights Reserved. # Python +import os import cgi import datetime import dateutil @@ -263,6 +264,16 @@ class ApiV1ConfigView(APIView): return Response(license_data) return Response({"error": "Invalid license"}, status=status.HTTP_400_BAD_REQUEST) + def delete(self, request): + if not request.user.is_superuser: + return Response(None, status=status.HTTP_404_NOT_FOUND) + try: + os.remove(TASK_FILE) + mongodb_control.delay('stop') + except OSError: + pass + return Response() + class DashboardView(APIView): view_name = "Dashboard"