1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #268 from matburt/support_DELETE_license

Support DELETE of the license on the config endpoint
This commit is contained in:
Matthew Jones 2015-06-05 16:52:23 -04:00
commit e471798918

View File

@ -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"