|
53 | 53 | from vulnerabilities.throttling import AnonUserUIThrottle |
54 | 54 | from vulnerabilities.utils import TYPES_WITH_MULTIPLE_IMPORTERS |
55 | 55 | from vulnerabilities.utils import get_advisories_from_groups |
56 | | -from vulnerabilities.utils import merge_and_save_grouped_advisories |
57 | 56 | from vulnerablecode import __version__ as VULNERABLECODE_VERSION |
58 | 57 | from vulnerablecode.settings import env |
59 | 58 |
|
@@ -327,6 +326,7 @@ def get_context_data(self, **kwargs): |
327 | 326 | return context |
328 | 327 |
|
329 | 328 | is_grouped = models.AdvisorySet.objects.filter(package=package).exists() |
| 329 | + print(f"Is package {package.purl} grouped? {is_grouped}") |
330 | 330 |
|
331 | 331 | if is_grouped: |
332 | 332 | context["grouped"] = True |
@@ -390,42 +390,6 @@ def get_context_data(self, **kwargs): |
390 | 390 |
|
391 | 391 | return context |
392 | 392 |
|
393 | | - # if package.type in TYPES_WITH_MULTIPLE_IMPORTERS: |
394 | | - # affecting_advisories = AdvisoryV2.objects.latest_affecting_advisories_for_purl( |
395 | | - # purl=package.purl |
396 | | - # ) |
397 | | - |
398 | | - # fixed_by_advisories = AdvisoryV2.objects.latest_fixed_by_advisories_for_purl( |
399 | | - # purl=package.purl |
400 | | - # ) |
401 | | - # fixed_pkg_details = get_fixed_package_details(package) |
402 | | - # context["fixed_package_details"] = fixed_pkg_details |
403 | | - # context["grouped"] = True |
404 | | - |
405 | | - # affecting_advisories = affecting_advisories.prefetch_related( |
406 | | - # "aliases", |
407 | | - # "impacted_packages__affecting_packages", |
408 | | - # "impacted_packages__fixed_by_packages", |
409 | | - # ) |
410 | | - |
411 | | - # affected_by_advisories: List[GroupedAdvisory] = merge_and_save_grouped_advisories( |
412 | | - # package, affecting_advisories, "affecting" |
413 | | - # ) |
414 | | - |
415 | | - # fixed_by_advisories = fixed_by_advisories.prefetch_related( |
416 | | - # "aliases", |
417 | | - # "impacted_packages__affecting_packages", |
418 | | - # "impacted_packages__fixed_by_packages", |
419 | | - # ) |
420 | | - |
421 | | - # fixing_advisories: List[GroupedAdvisory] = merge_and_save_grouped_advisories( |
422 | | - # package, fixed_by_advisories, "fixing" |
423 | | - # ) |
424 | | - |
425 | | - # context["affected_by_advisories_v2"] = affected_by_advisories |
426 | | - # context["fixing_advisories_v2"] = fixing_advisories |
427 | | - # return context |
428 | | - |
429 | 393 | def get_object(self, queryset=None): |
430 | 394 | if queryset is None: |
431 | 395 | queryset = self.get_queryset() |
|
0 commit comments