0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-05-18 00:49:09 -04:00

Fix virutal user

This commit is contained in:
Lunny Xiao 2022-11-14 10:44:20 +08:00 committed by Jason Song
parent e19f2c8c44
commit d8b401ab06

View File

@ -4,13 +4,24 @@
package bots
import user_model "code.gitea.io/gitea/models/user"
import (
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/structs"
)
// NewBotUser creates and returns a fake user for running the build.
func NewBotUser() *user_model.User {
return &user_model.User{
ID: -2,
Name: "gitea-bots",
LowerName: "gitea-bots",
ID: -2,
Name: "gitea-bots",
LowerName: "gitea-bots",
IsActive: true,
FullName: "Gitea Bots",
Email: "teabot@gitea.io",
KeepEmailPrivate: true,
LoginName: "gitea-bots",
Type: user_model.UserTypeIndividual,
AllowCreateOrganization: true,
Visibility: structs.VisibleTypePublic,
}
}