testing is_active
This commit is contained in:
1 parent
25810b0fcc
commit
bfd67c8a17
3 files changed
+25
-1
No files matched your search
@@ -262,6 +262,18 @@ class TestingView(generics.ListCreateAPIView):
|
||||
print(e)
|
||||
return Response({"status": "error", "message": str(e)}, status=400)
|
||||
|
||||
def put(self, request):
|
||||
testing_id = request.data.get("id")
|
||||
try:
|
||||
testing = Testing.objects.get(id=testing_id)
|
||||
testing.is_active = False
|
||||
testing.save()
|
||||
return Response({"status": "success", "message": "Testing is not active."},
|
||||
status=200)
|
||||
except DatabaseError as e:
|
||||
print(e)
|
||||
return Response({"status": "error", "message": str(e)}, status=400)
|
||||
|
||||
def delete(self, request):
|
||||
testing_id = request.data.get("id")
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user