mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 14:44:35 -04:00
Replace -1 with GhostUserID (#27703)
This commit is contained in:
parent
eb1478791f
commit
881806a50b
7 changed files with 18 additions and 13 deletions
|
@ -219,7 +219,7 @@ func (issue *Issue) LoadPoster(ctx context.Context) (err error) {
|
|||
if issue.Poster == nil && issue.PosterID != 0 {
|
||||
issue.Poster, err = user_model.GetPossibleUserByID(ctx, issue.PosterID)
|
||||
if err != nil {
|
||||
issue.PosterID = -1
|
||||
issue.PosterID = user_model.GhostUserID
|
||||
issue.Poster = user_model.NewGhostUser()
|
||||
if !user_model.IsErrUserNotExist(err) {
|
||||
return fmt.Errorf("getUserByID.(poster) [%d]: %w", issue.PosterID, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue