Skip to content

Commit

Permalink
Set is_published to True for imported objects
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Feb 29, 2024
1 parent fc86564 commit 117f02b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/library/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def import_requirement_node(self, framework_object: Framework):
maturity=self.requirement_data.get("maturity"),
locale=framework_object.locale,
default_locale=framework_object.default_locale,
is_published=True
)

for threat in self.requirement_data.get("threats", []):
Expand Down Expand Up @@ -217,6 +218,7 @@ def import_framework(self, library_object: Library):
provider=library_object.provider,
locale=library_object.locale,
default_locale=library_object.default_locale, # Change this in the future ?
is_published=True
)

for requirement_node in self._requirement_nodes:
Expand All @@ -242,7 +244,7 @@ def import_threat(self, library_object: Library):
name=self.threat_data.get("name"),
description=self.threat_data.get("description"),
provider=library_object.provider,
is_published=self.threat_data.get("is_published", True),
is_published=True,
locale=library_object.locale,
default_locale=library_object.default_locale, # Change this in the future ?
)
Expand Down Expand Up @@ -278,7 +280,7 @@ def import_security_function(self, library_object: Library):
provider=library_object.provider,
typical_evidence=self.security_function_data.get("typical_evidence"),
category=self.security_function_data.get("category"),
is_published=self.security_function_data.get("is_published", True),
is_published=True,
locale=library_object.locale,
default_locale=library_object.default_locale, # Change this in the future ?
)
Expand Down Expand Up @@ -323,6 +325,7 @@ def import_risk_matrix(self, library_object: Library):
is_enabled=self.risk_matrix_data.get("is_enabled", True),
locale=library_object.locale,
default_locale=library_object.default_locale, # Change this in the future ?
is_published=True
)


Expand Down

0 comments on commit 117f02b

Please sign in to comment.