From 6087fb3af4149b1a27b333ec33f3f3cf2f3ee9ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Wed, 9 Apr 2025 14:28:17 +0200
Subject: [PATCH] [FIX] move compute static_data after generating daily curves

---
 models/queue_job_batch.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/models/queue_job_batch.py b/models/queue_job_batch.py
index 8477ada..f62f309 100644
--- a/models/queue_job_batch.py
+++ b/models/queue_job_batch.py
@@ -19,7 +19,6 @@ class QueueJobBatch(models.Model):
 
     def post_finished_action(self):
         if self.acc_operation_id and self.batch_type == "monthly_curves":
-            self.acc_operation_id.set_static_data()
             if (
                 not self.acc_operation_id.is_cdc_data_exists
                 and self.finished_job_count > 0
@@ -42,3 +41,5 @@ class QueueJobBatch(models.Model):
                 start_date=self.start_date,
                 end_date=self.end_date,
             )
+            # Recompute static datas for last month
+            self.acc_operation_id.set_static_data()
-- 
GitLab