From 58d510c6004a9acf1d2bf598e8c3a4fc615f83ba Mon Sep 17 00:00:00 2001 From: Wes <169498386+wes-mil@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:17:10 -0500 Subject: [PATCH] BED-5066: Add duplicate slug check to UpdateSSOProvider as well --- cmd/api/src/database/sso_providers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/api/src/database/sso_providers.go b/cmd/api/src/database/sso_providers.go index 85826e107..f820bebd3 100644 --- a/cmd/api/src/database/sso_providers.go +++ b/cmd/api/src/database/sso_providers.go @@ -198,6 +198,8 @@ func (s *BloodhoundDB) UpdateSSOProvider(ctx context.Context, ssoProvider model. if result.Error != nil { if strings.Contains(result.Error.Error(), "duplicate key value violates unique constraint \"sso_providers_name_key\"") { return fmt.Errorf("%w: %v", ErrDuplicateSSOProviderName, tx.Error) + } else if strings.Contains(result.Error.Error(), "duplicate key value violates unique constraint \"sso_providers_slug_key\"") { + return fmt.Errorf("%w: %v", ErrDuplicateSSOProviderName, tx.Error) } }