diff --git a/agate/agate/tests/test_api_endpoints.py b/agate/agate/tests/test_api_endpoints.py index fc7796e..213e68c 100644 --- a/agate/agate/tests/test_api_endpoints.py +++ b/agate/agate/tests/test_api_endpoints.py @@ -117,8 +117,8 @@ def test_delete_ingestion_attempt(self): self.assertFalse(response.json()["archived"]) # Now delete the object - response = self.client.get(reverse("agate:delete", args=["user4"])) - self.assertEqual(response.status_code, status.HTTP_200_OK) + response = self.client.delete(reverse("agate:delete", args=["user4"])) + self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) # Check that we can no longer find it (because it has been deleted) response = self.client.get(reverse("agate:single", args=["user4"])) diff --git a/agate/agate/views.py b/agate/agate/views.py index 2a5ecbd..f0ab434 100644 --- a/agate/agate/views.py +++ b/agate/agate/views.py @@ -51,14 +51,14 @@ def archive_ingestion_attempt(request, uuid=""): return HttpResponse(status=status.HTTP_200_OK) -@api_view(["GET"]) +@api_view(["DELETE"]) def delete_ingestion_attempt(request, uuid=""): obj = get_object_or_404(IngestionAttempt, uuid=uuid) auth = request.headers.get("Authorization") check_authorized(auth, obj.site, obj.project) obj.delete() - return HttpResponse(status=status.HTTP_200_OK) + return Response(status=status.HTTP_204_NO_CONTENT) def projects(request):