Skip to content

Commit

Permalink
Fix 500 error when adding PR comment (#29622)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored Mar 6, 2024
1 parent c481dba commit 61619c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routers/web/repo/pull_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

issues_model "code.gitea.io/gitea/models/issues"
pull_model "code.gitea.io/gitea/models/pull"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
Expand All @@ -19,6 +20,7 @@ import (
"code.gitea.io/gitea/services/context/upload"
"code.gitea.io/gitea/services/forms"
pull_service "code.gitea.io/gitea/services/pull"
user_service "code.gitea.io/gitea/services/user"
)

const (
Expand Down Expand Up @@ -203,6 +205,10 @@ func renderConversation(ctx *context.Context, comment *issues_model.Comment, ori
return
}
ctx.Data["AfterCommitID"] = pullHeadCommitID
ctx.Data["CanBlockUser"] = func(blocker, blockee *user_model.User) bool {
return user_service.CanBlockUser(ctx, ctx.Doer, blocker, blockee)
}

if origin == "diff" {
ctx.HTML(http.StatusOK, tplDiffConversation)
} else if origin == "timeline" {
Expand Down

0 comments on commit 61619c8

Please sign in to comment.