Skip to content

Add delete to vulnreport endpoint #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pulp_service/pulp_service/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from rest_framework.exceptions import APIException
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin
from rest_framework.mixins import DestroyModelMixin, ListModelMixin, RetrieveModelMixin

from pulpcore.app.response import OperationPostponedResponse
from pulpcore.app.viewsets import ContentGuardViewSet, NamedModelViewSet, RolesMixin, TaskViewSet
Expand Down Expand Up @@ -147,14 +147,14 @@ def view_name(cls):
return "admintasks"


class VulnerabilityReport(NamedModelViewSet, ListModelMixin, RetrieveModelMixin):
class VulnerabilityReport(NamedModelViewSet, ListModelMixin, RetrieveModelMixin, DestroyModelMixin):

endpoint_name = "vuln_report"
queryset = VulnReport.objects.all()
serializer_class = VulnerabilityReportSerializer

def create(self, request):
serializer = ContentScanSerializer(data=request.data, context={'request': request})
serializer = ContentScanSerializer(data=request.data, context={"request": request})
serializer.is_valid(raise_exception=True)

shared_resources = None
Expand Down