mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix: create temp user no longer sets ID to 0 for all users (#64149)
* fix: create temp user no longer sets ID to 0 for all users The xorm tag added to the tempuser ID field caused xorm to create all temp users with ID 0. Removing that tag allows xorm to set the ID based on the database result instead. I also added a test which was failing before this. Fixes #63995
This commit is contained in:
@@ -32,6 +32,13 @@ func TestIntegrationTempUserCommandsAndQueries(t *testing.T) {
|
||||
require.Nil(t, err)
|
||||
}
|
||||
|
||||
t.Run("Can create multiple temp users", func(t *testing.T) {
|
||||
setup(t)
|
||||
created, err := store.CreateTempUser(context.Background(), &cmd)
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, int64(2), created.ID)
|
||||
})
|
||||
|
||||
t.Run("Should be able to get temp users by org id", func(t *testing.T) {
|
||||
setup(t)
|
||||
query := tempuser.GetTempUsersQuery{OrgID: 2256, Status: tempuser.TmpUserInvitePending}
|
||||
|
||||
Reference in New Issue
Block a user