mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Support DELETE of the license on the config endpoint
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
|
import os
|
||||||
import cgi
|
import cgi
|
||||||
import datetime
|
import datetime
|
||||||
import dateutil
|
import dateutil
|
||||||
@@ -263,6 +264,16 @@ class ApiV1ConfigView(APIView):
|
|||||||
return Response(license_data)
|
return Response(license_data)
|
||||||
return Response({"error": "Invalid license"}, status=status.HTTP_400_BAD_REQUEST)
|
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):
|
class DashboardView(APIView):
|
||||||
|
|
||||||
view_name = "Dashboard"
|
view_name = "Dashboard"
|
||||||
|
|||||||
Reference in New Issue
Block a user