Skip to content

Commit 0e6af3f

Browse files
committed
Add boolean mapping
1 parent e5395ca commit 0e6af3f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/apps/owasp/management/commands/owasp_update_project_health_metrics_scores.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def handle(self, *args, **options):
3030
"unanswered_issues_count",
3131
"unassigned_issues_count",
3232
]
33+
boolean_mapping = {
34+
"open_issues_count": "has_long_open_issues",
35+
"unanswered_issues_count": "has_long_unanswered_issues",
36+
"unassigned_issues_count": "has_long_unassigned_issues",
37+
}
3338
to_save = []
3439
requirements_cache = {}
3540
for metric in metrics:
@@ -49,6 +54,8 @@ def handle(self, *args, **options):
4954
for field in backward_fields:
5055
if getattr(metric, field) <= getattr(requirements, field):
5156
score += 6.0
57+
elif field in boolean_mapping:
58+
setattr(metric, boolean_mapping[field], True)
5259

5360
# Evaluate compliance with funding and leaders requirements
5461
if metric.is_funding_requirements_compliant:

0 commit comments

Comments
 (0)