mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
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:
parent
533bed6d94
commit
9c1ef8b16e
@ -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 {
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user