Replace -1 with GhostUserID (#27703)

This commit is contained in:
Nanguan Lin 2023-10-20 22:43:08 +08:00 committed by GitHub
parent eb1478791f
commit 881806a50b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 13 deletions

View file

@ -27,7 +27,7 @@ func AvatarByUserName(ctx *context.Context) {
size := int(ctx.ParamsInt64(":size"))
var user *user_model.User
if strings.ToLower(userName) != "ghost" {
if strings.ToLower(userName) != user_model.GhostUserLowerName {
var err error
if user, err = user_model.GetUserByName(ctx, userName); err != nil {
if user_model.IsErrUserNotExist(err) {