MCPcopy Index your code
hub / github.com/aboutcode-org/vulnerablecode / get_context_data

Method get_context_data

vulnerabilities/views.py:166–179  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

164 slug_field = "purl"
165
166 def get_context_data(self, **kwargs):
167 context = super().get_context_data(**kwargs)
168 package = self.object
169 context["package"] = package
170 context["affected_by_vulnerabilities"] = package.affected_by.order_by("vulnerability_id")
171 # Ghost package should not fix any vulnerability.
172 context["fixing_vulnerabilities"] = (
173 None if package.is_ghost else package.fixing.order_by("vulnerability_id")
174 )
175 context["package_search_form"] = PackageSearchForm(self.request.GET)
176 context["fixed_package_details"] = package.fixed_package_details
177
178 context["history"] = list(package.history)
179 return context
180
181 def get_object(self, queryset=None):
182 if queryset is None:

Callers

nothing calls this directly

Calls 2

PackageSearchFormClass · 0.90
get_context_dataMethod · 0.45

Tested by

no test coverage detected