File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,21 +139,28 @@ class ProjectViewSet(
139139 queryset = Project .objects .all ()
140140 serializer_class = ProjectSerializer
141141 from rest_framework .response import Response
142+
143+
142144from rest_framework import status
143145
146+
144147@action (detail = True , methods = ["get" ])
145148def sbom (self , request , * args , ** kwargs ):
146149 project = self .get_object ()
147150 purl = request .query_params .get ("purl" )
148151
149152 if not purl :
150- return Response ({"error" : "purl is required" }, status = status .HTTP_400_BAD_REQUEST )
153+ return Response (
154+ {"error" : "purl is required" }, status = status .HTTP_400_BAD_REQUEST
155+ )
151156
152- return Response ({
153- "project" : project .name ,
154- "purl" : purl ,
155- "sbom" : "CycloneDX SBOM will be generated here"
156- })
157+ return Response (
158+ {
159+ "project" : project .name ,
160+ "purl" : purl ,
161+ "sbom" : "CycloneDX SBOM will be generated here" ,
162+ }
163+ )
157164 """
158165 A viewset that provides the ability to list, get, create, and destroy projects.
159166 Multiple actions are available to manage project instances.
You can’t perform that action at this time.
0 commit comments