From 6de248f4e66fa83beba5d6c512bdc30f0a035ea7 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:33:19 +0200 Subject: [PATCH] Update 0010_rename_score_definition_framework_scores_definition_and_more.py initialize score for all existing compliance assessment, as there is no default value --- ...score_definition_framework_scores_definition_and_more.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 3dc58f622..49303284b 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 @@ -26,8 +26,12 @@ def fix_well_known_scores(apps, schema_editor): (assessment.min_score, assessment.max_score) = WELL_KNOWN_SCORES[ assessment.framework.urn ] - assessment.save() print("custom migration for", assessment.framework.urn) + else: + # no default value, so fix it now + (assessment.min_score, assessment.max_score) = (0, 100) + assessment.save() + class Migration(migrations.Migration):