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.
This commit is contained in:
Ted Johansson 2024-10-22 11:17:27 +08:00 committed by GitHub
parent f8b0c33567
commit f31f8cc15f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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