]> source.dussan.org Git - gitea.git/commit
enable system users for comment.LoadPoster (#28014) (#28032)
authorGiteabot <teabot@gitea.io>
Tue, 14 Nov 2023 13:50:05 +0000 (21:50 +0800)
committerGitHub <noreply@github.com>
Tue, 14 Nov 2023 13:50:05 +0000 (14:50 +0100)
commit09efce9da2c108cc5b029d352514f9a505216b58
tree6af5daab58b29d1317cbb722dfe407952302a8f5
parent124a9957d086a054f45ca79ea5c5b6b6461a7f56
enable system users for comment.LoadPoster (#28014) (#28032)

Backport #28014 by @earl-warren

System users (Ghost, ActionsUser, etc) have a negative id and may be the
author of a comment, either because it was created by a now deleted user
or via an action using a transient token.

The GetPossibleUserByID function has special cases related to system
users and will not fail if given a negative id.

Refs: https://codeberg.org/forgejo/forgejo/issues/1425

(cherry picked from commit 6a2d2fa24390116d31ae2507c0a93d423f690b7b)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
models/issues/comment.go
tests/integration/api_comment_test.go