From a6823f6d532fb5e667a75842438115cbe9525b58 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Thu, 7 Nov 2024 08:15:57 +0100 Subject: [PATCH] [FIX] runbot: adapt migration script Fix a failure when a build error is not linked to any build. It happens when a build error was merged into another. --- runbot/migrations/17.0.5.8/post-migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runbot/migrations/17.0.5.8/post-migration.py b/runbot/migrations/17.0.5.8/post-migration.py index d65051f3..3dc783af 100644 --- a/runbot/migrations/17.0.5.8/post-migration.py +++ b/runbot/migrations/17.0.5.8/post-migration.py @@ -76,7 +76,7 @@ def migrate(cr, version): build_count = 0 first_seen_build_id = first_seen_date = last_seen_build_id = last_seen_date = None if error_id in vals_by_error: - error_vals = [vals_by_error[error_id] for error_id in all_errors] + error_vals = [vals_by_error[error_id] for error_id in all_errors if error_id in vals_by_error] first_seen_build_id = min(vals[0] for vals in error_vals) first_seen_date = min(vals[1] for vals in error_vals) last_seen_build_id = max(vals[2] for vals in error_vals)