fix(ens): solve division by zero at reporting (#9451)

Co-authored-by: Pedro Martín <pedromarting3@gmail.com>
This commit is contained in:
Prowler BotandPedro Martín authored and GitHub committed 2025-12-04 10:21:35 +01:00
1 parent e6fc91c821
commit e093525b41
2 files changed
+11 -2

No files matched your search

+1
View File
@@ -7,6 +7,7 @@ All notable changes to the **Prowler API** are documented in this file.
### Fixed
- Unique constraint violation during compliance overviews task [(#9436)](https://github.com/prowler-cloud/prowler/pull/9436)
- Division by zero error in ENS PDF report when all requirements are manual [(#9443)](https://github.com/prowler-cloud/prowler/pull/9443)
---
+10 -2
View File
@@ -2229,12 +2229,20 @@ def generate_ens_report(
[
"CUMPLE",
str(passed_requirements),
f"{(passed_requirements / total_requirements * 100):.1f}%",
(
f"{(passed_requirements / total_requirements * 100):.1f}%"
if total_requirements > 0
else "0.0%"
),
],
[
"NO CUMPLE",
str(failed_requirements),
f"{(failed_requirements / total_requirements * 100):.1f}%",
(
f"{(failed_requirements / total_requirements * 100):.1f}%"
if total_requirements > 0
else "0.0%"
),
],
["TOTAL", str(total_requirements), "100%"],
]