From de8d2287ccc73365ba01973fd2f3bd7287f7ae26 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Sat, 27 Apr 2024 23:48:44 +0200 Subject: [PATCH] ruff --- ...on_framework_scores_definition_and_more.py | 47 ++++++++++--------- backend/library/utils.py | 9 +++- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/backend/core/migrations/0010_rename_score_definition_framework_scores_definition_and_more.py b/backend/core/migrations/0010_rename_score_definition_framework_scores_definition_and_more.py index 0414f1409..9043d97b6 100644 --- a/backend/core/migrations/0010_rename_score_definition_framework_scores_definition_and_more.py +++ b/backend/core/migrations/0010_rename_score_definition_framework_scores_definition_and_more.py @@ -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", ), ] diff --git a/backend/library/utils.py b/backend/library/utils.py index 4714d9440..5ec9da18e 100644 --- a/backend/library/utils.py +++ b/backend/library/utils.py @@ -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)