1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
7 changed files with 18 additions and 13 deletions

View File

@@ -58,8 +58,7 @@ func GenerateRandomAvatar(ctx context.Context, u *User) error {
// AvatarLinkWithSize returns a link to the user's avatar with size. size <= 0 means default size
func (u *User) AvatarLinkWithSize(ctx context.Context, size int) string {
if u.ID == -1 {
// ghost user
if u.IsGhost() {
return avatars.DefaultAvatarLink()
}