From 52b32c37ad637cf133cb90696c8971d6ec2261be Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 22 Nov 2022 16:04:10 +0800 Subject: [PATCH] Use a new name for bots --- models/user/user_system.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/models/user/user_system.go b/models/user/user_system.go index 3ced960239..39f0835d50 100644 --- a/models/user/user_system.go +++ b/models/user/user_system.go @@ -36,19 +36,22 @@ func NewReplaceUser(name string) *User { } } -const BotUserID = -2 +const ( + BotUserID = -2 + BotUserName = "[robot]gitea-bots" +) // NewBotUser creates and returns a fake user for running the build. func NewBotUser() *User { return &User{ ID: BotUserID, - Name: "gitea-bots", - LowerName: "gitea-bots", + Name: "[robot]gitea-bots", + LowerName: "[robot]gitea-bots", IsActive: true, FullName: "Gitea Bots", Email: "teabot@gitea.io", KeepEmailPrivate: true, - LoginName: "gitea-bots", + LoginName: "[robot]gitea-bots", Type: UserTypeIndividual, AllowCreateOrganization: true, Visibility: structs.VisibleTypePublic, @@ -59,5 +62,5 @@ func (u *User) IsBots() bool { if u == nil { return false } - return u.ID == BotUserID && u.Name == "gitea-bots" + return u.ID == BotUserID && u.Name == BotUserName }