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 3295b0bc7..3dc58f622 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 @@ -7,23 +7,29 @@ WELL_KNOWN_SCORES = { "urn:intuitem:risk:framework:tisax-v6.0.2": (0, 5), "urn:intuitem:risk:framework:ccb-cff-2023-03-01": (1, 5), - "urn:intuitem:risk:framework:nist-csf-2.0": (1,4), + "urn:intuitem:risk:framework:nist-csf-2.0": (1, 4), } + def fix_well_known_scores(apps, schema_editor): - Framework = apps.get_model('core', 'Framework') - ComplianceAssessment = apps.get_model('core', 'ComplianceAssessment') + Framework = apps.get_model("core", "Framework") + ComplianceAssessment = apps.get_model("core", "ComplianceAssessment") for framework in Framework.objects.all(): if framework.urn in WELL_KNOWN_SCORES: - (framework.min_score, framework.max_score) = WELL_KNOWN_SCORES[framework.urn] + (framework.min_score, framework.max_score) = WELL_KNOWN_SCORES[ + framework.urn + ] framework.save() print("custom migration for", framework.urn) for assessment in ComplianceAssessment.objects.all(): if assessment.framework.urn in WELL_KNOWN_SCORES: - (assessment.min_score, assessment.max_score) = WELL_KNOWN_SCORES[assessment.framework.urn] + (assessment.min_score, assessment.max_score) = WELL_KNOWN_SCORES[ + assessment.framework.urn + ] assessment.save() print("custom migration for", assessment.framework.urn) + class Migration(migrations.Migration): dependencies = [ ("core", "0009_framework_max_score_framework_min_score_and_more"), diff --git a/backend/core/models.py b/backend/core/models.py index ea2bf1cea..19ab2c514 100644 --- a/backend/core/models.py +++ b/backend/core/models.py @@ -1283,7 +1283,6 @@ def save(self, *args, **kwargs) -> None: self.scores_definition = self.framework.scores_definition super().save(*args, **kwargs) - def get_global_score(self): requirement_assessments_scored = ( RequirementAssessment.objects.filter(compliance_assessment=self) diff --git a/backend/requirements.txt b/backend/requirements.txt index 4ce43ef8a..f019233cc 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -7,10 +7,10 @@ pytest-html==4.1.1 django-filter==24.2 whitenoise==6.6.0 argon2-cffi==23.1.0 -typing-extensions==4.10.0 -djangorestframework==3.15.0 +typing-extensions==4.11.0 +djangorestframework==3.15.1 django-stubs==4.2.7 -coverage==7.4.4 +coverage==7.5.0 django-tailwind==3.8.0 pyyaml==6.0.1 django-structlog==8.0.0