mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 11:40:05 -03:30
Support DELETE of the license on the config endpoint
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user