Auth: Remove caseinsensitive check on update user (#86286)

* Removal: case insensitive check on update

* refactor and removal of test for duplicate user

* refactor to still shadow user variable
This commit is contained in:
Eric Leijonmarck 2024-04-16 17:47:17 +01:00 committed by GitHub
parent 533bed6d94
commit 9c1ef8b16e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 13 deletions

View File

@ -333,10 +333,6 @@ func (ss *sqlStore) Update(ctx context.Context, cmd *user.UpdateUserCommand) err
return err
}
if err := ss.userCaseInsensitiveLoginConflict(ctx, sess, user.Login, user.Email); err != nil {
return err
}
if cmd.IsGrafanaAdmin != nil && !*cmd.IsGrafanaAdmin {
// validate that after update there is at least one server admin
if err := validateOneAdminLeft(ctx, sess); err != nil {

View File

@ -924,15 +924,6 @@ func TestIntegrationUserUpdate(t *testing.T) {
}
})
t.Run("Testing DB - update generates duplicate user", func(t *testing.T) {
err := userStore.Update(context.Background(), &user.UpdateUserCommand{
Login: "loginuser2",
UserID: users[0].ID,
})
require.Error(t, err)
})
t.Run("Testing DB - update lowercases existing user", func(t *testing.T) {
err := userStore.Update(context.Background(), &user.UpdateUserCommand{
Login: "loginUSER0",