Skip to content

Commit

Permalink
Merge pull request #966 from intuitem/CA-532-filter-requirement-asses…
Browse files Browse the repository at this point in the history
…sments-by-selected-implementation-groups-in-tree-map

Filter requirement assessments by selected implementation groups in tree map
  • Loading branch information
nas-tabchiche authored Oct 22, 2024
2 parents 608c30f + d44306c commit a43a155
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions backend/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,18 +797,17 @@ def build_audits_tree_metrics(user):
block_prj = {"name": project.name, "domain": domain.name, "children": []}
children = []
for audit in ComplianceAssessment.objects.filter(project=project):
cnt_reqs = RequirementAssessment.objects.filter(
compliance_assessment=audit
).count()
cnt_res = {}
for result in RequirementAssessment.Result.choices:
cnt_res[result[0]] = (
RequirementAssessment.objects.filter(
requirement__assessable=True
)
.filter(compliance_assessment=audit)
.filter(result=result[0])
.count()
requirement_assessments = audit.get_requirement_assessments(
include_non_assessable=False
)
cnt_res[result[0]] = len(
[
requirement
for requirement in requirement_assessments
if requirement.result == result[0]
]
)
blk_audit = {
"name": audit.name,
Expand Down

0 comments on commit a43a155

Please sign in to comment.