[GITEA] notifies admins on new user registration (squash) performance bottleneck

Refs: https://codeberg.org/forgejo/forgejo/issues/1479
(cherry picked from commit 97ac9147ff)
This commit is contained in:
JakobDev 2023-09-19 18:40:01 +02:00 committed by Earl Warren
parent 283f964894
commit 19f295c16b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 19 additions and 5 deletions

View file

@ -544,3 +544,13 @@ func Test_ValidateUser(t *testing.T) {
assert.EqualValues(t, expected, err == nil, fmt.Sprintf("case: %+v", kase))
}
}
func TestGetAllAdmins(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
admins, err := user_model.GetAllAdmins(db.DefaultContext)
assert.NoError(t, err)
assert.Len(t, admins, 1)
assert.Equal(t, int64(1), admins[0].ID)
}