From f31f8cc15fb70448975a63b724f36d216326c434 Mon Sep 17 00:00:00 2001 From: Ted Johansson Date: Tue, 22 Oct 2024 11:17:27 +0800 Subject: [PATCH] FIX: Avoid duplicate problem admin notices (#29329) As part of #29272 we made a unique index work on PG13 by introducing a dummy string to represent "NULL". We missed one spot, leading to a potential for duplicate admin notices for problems without a target. This fixes that. --- app/models/problem_check_tracker.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/problem_check_tracker.rb b/app/models/problem_check_tracker.rb index 4587c296ed4..20b74f52fac 100644 --- a/app/models/problem_check_tracker.rb +++ b/app/models/problem_check_tracker.rb @@ -62,7 +62,7 @@ class ProblemCheckTracker < ActiveRecord::Base def sound_the_alarm admin_notice.create_with( priority: check.priority, - details: details.merge(target:), + details: details.merge(target: target || ProblemCheck::NO_TARGET), ).find_or_create_by(identifier:) end