From 5f1b6b0fd122760c6ae224a34fe9bbb717e88908 Mon Sep 17 00:00:00 2001 From: Blake Owens Date: Wed, 10 Jan 2024 17:55:39 -0600 Subject: [PATCH] migration system settings fix --- dojo/db_migrations/0197_finding_sla_expiration_date.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dojo/db_migrations/0197_finding_sla_expiration_date.py b/dojo/db_migrations/0197_finding_sla_expiration_date.py index 01985eff598..bcb98c48dfb 100644 --- a/dojo/db_migrations/0197_finding_sla_expiration_date.py +++ b/dojo/db_migrations/0197_finding_sla_expiration_date.py @@ -37,7 +37,8 @@ def calculate_sla_expiration_dates(apps, schema_editor): Product = apps.get_model('dojo', 'Product') Finding = apps.get_model('dojo', 'Finding') - if System_Settings.objects.get().enable_finding_sla: + ss, _ = System_Settings.objects.get_or_create() + if ss.enable_finding_sla: for p in Product.objects.all(): sla_config = SLA_Configuration.objects.filter(id=p.sla_configuration_id).first() for f in Finding.objects.filter(test__engagement__product__id=p.id):