Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-intuitem committed Apr 27, 2024
1 parent 050ec5c commit de8d228
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,49 @@


class Migration(migrations.Migration):

dependencies = [
('core', '0009_framework_max_score_framework_min_score_and_more'),
("core", "0009_framework_max_score_framework_min_score_and_more"),
]

operations = [
migrations.RenameField(
model_name='framework',
old_name='score_definition',
new_name='scores_definition',
model_name="framework",
old_name="score_definition",
new_name="scores_definition",
),
migrations.RemoveField(
model_name='requirementnode',
name='level',
model_name="requirementnode",
name="level",
),
migrations.RemoveField(
model_name='requirementnode',
name='maturity',
model_name="requirementnode",
name="maturity",
),
migrations.AddField(
model_name='complianceassessment',
name='selected_implementation_groups',
field=models.JSONField(blank=True, null=True, verbose_name='Selected implementation groups'),
model_name="complianceassessment",
name="selected_implementation_groups",
field=models.JSONField(
blank=True, null=True, verbose_name="Selected implementation groups"
),
),
migrations.AddField(
model_name='framework',
name='implementation_groups_definition',
field=models.JSONField(blank=True, null=True, verbose_name='Implementation groups definition'),
model_name="framework",
name="implementation_groups_definition",
field=models.JSONField(
blank=True, null=True, verbose_name="Implementation groups definition"
),
),
migrations.AddField(
model_name='requirementassessment',
name='selected',
field=models.BooleanField(default=True, verbose_name='Selected'),
model_name="requirementassessment",
name="selected",
field=models.BooleanField(default=True, verbose_name="Selected"),
),
migrations.AddField(
model_name='requirementnode',
name='implementation_groups',
field=models.JSONField(null=True, verbose_name='Implementation groups'),
model_name="requirementnode",
name="implementation_groups",
field=models.JSONField(null=True, verbose_name="Implementation groups"),
),
migrations.DeleteModel(
name='RequirementLevel',
name="RequirementLevel",
),
]
9 changes: 7 additions & 2 deletions backend/library/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,19 @@ def import_framework(self, library_object: Library):
min_score=min_score,
max_score=max_score,
scores_definition=self.framework_data.get("scores_definition"),
implementation_groups_definition=self.framework_data.get("implementation_groups_definition"),
implementation_groups_definition=self.framework_data.get(
"implementation_groups_definition"
),
provider=library_object.provider,
locale=library_object.locale,
default_locale=library_object.default_locale, # Change this in the future ?
is_published=True,
)
print("framework_object1", self.framework_data.get("scores_definition"))
print("framework_object2", self.framework_data.get("implementation_groups_definition"))
print(
"framework_object2",
self.framework_data.get("implementation_groups_definition"),
)
for requirement_node in self._requirement_nodes:
requirement_node.import_requirement_node(framework_object)

Expand Down

0 comments on commit de8d228

Please sign in to comment.