API endpoint that allows viewing CodeFix entries.
| 677 | |
| 678 | |
| 679 | class CodeFixV2ViewSet(viewsets.ReadOnlyModelViewSet): |
| 680 | """ |
| 681 | API endpoint that allows viewing CodeFix entries. |
| 682 | """ |
| 683 | |
| 684 | queryset = CodeFixV2.objects.all() |
| 685 | serializer_class = CodeFixV2Serializer |
| 686 | |
| 687 | def get_queryset(self): |
| 688 | """ |
| 689 | Optionally filter by vulnerability ID. |
| 690 | """ |
| 691 | queryset = super().get_queryset() |
| 692 | advisory_id = self.request.query_params.get("advisory_id") |
| 693 | if advisory_id: |
| 694 | queryset = queryset.filter(advisory__avid=advisory_id) |
| 695 | return queryset |
| 696 | |
| 697 | |
| 698 | class CreateListRetrieveUpdateViewSet( |