Skip to content

Commit

Permalink
feat: keep order of security objectives (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-intuitem authored Nov 29, 2024
2 parents 394f9ef + 08decdb commit 4235018
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,13 @@ def get_security_objectives(self) -> dict[str, dict[str, dict[str, int | bool]]]
If the asset is a supporting asset, the security objectives are the union of the security objectives of all the primary assets it supports.
If multiple ancestors share the same security objective, its value in the result is its highest value among the ancestors.
"""
if self.security_objectives.get("objectives"):
self.security_objectives["objectives"] = {
key: self.security_objectives["objectives"][key]
for key in Asset.DEFAULT_SECURITY_OBJECTIVES
if key in self.security_objectives["objectives"]
}

if self.is_primary:
return self.security_objectives

Expand Down

0 comments on commit 4235018

Please sign in to comment.