fix(findings): exclude blank resource types from metadata endpoints (#8030)

Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
This commit is contained in:
Prowler Bot
2025-06-16 15:14:53 +02:00
committed by GitHub
parent 63458cd976
commit 95314dfc2b
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ All notable changes to the **Prowler API** are documented in this file.
### Fixed
- Normalize provider UID to ensure safe and unique export directory paths [(#8007)](https://github.com/prowler-cloud/prowler/pull/8007).
- Blank resource types in `/metadata` endpoints [(#8027)](https://github.com/prowler-cloud/prowler/pull/8027)
---
+4
View File
@@ -1909,6 +1909,8 @@ class FindingViewSet(PaginateByPkMixin, BaseRLSViewSet):
)
resource_types = list(
queryset.values_list("resource_type", flat=True)
.exclude(resource_type__isnull=True)
.exclude(resource_type__exact="")
.distinct()
.order_by("resource_type")
)
@@ -2010,6 +2012,8 @@ class FindingViewSet(PaginateByPkMixin, BaseRLSViewSet):
)
resource_types = list(
queryset.values_list("resource_type", flat=True)
.exclude(resource_type__isnull=True)
.exclude(resource_type__exact="")
.distinct()
.order_by("resource_type")
)