From c7ad7002649743a5d17338b9ab0133d8db896bcb Mon Sep 17 00:00:00 2001 From: Michael Mraka Date: Wed, 19 Jun 2024 13:39:15 +0200 Subject: [PATCH] RHINENG-10439: create EnvironmentID if message does not contain it --- listener/templates.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/listener/templates.go b/listener/templates.go index 78ddd80d8..e9fe8cd24 100644 --- a/listener/templates.go +++ b/listener/templates.go @@ -88,6 +88,11 @@ func TemplateUpdate(template mqueue.TemplateResponse) error { return errors.Wrap(err, "saving account into the database") } + // fix empty EnvironmentID until Content Sources will start sending it + if template.EnvironmentID == "" { + template.EnvironmentID = strings.ReplaceAll(template.UUID, "-", "") + } + row := models.Template{ RhAccountID: accountID, UUID: template.UUID,