fix: agit prompt to create pull request

template error for block user alert
This commit is contained in:
TheFox0x7 2024-12-27 21:03:43 +01:00
parent 7d3673a127
commit 32a320d4d6
No known key found for this signature in database
GPG Key ID: 6CA33903484AF7C2
2 changed files with 4 additions and 1 deletions

View File

@ -705,7 +705,8 @@ Gitea or set your environment appropriately.`, "")
if err == nil {
for _, res := range resp.Results {
hookPrintResult(res.ShouldShowMessage, res.IsCreatePR, res.HeadBranch, res.URL)
// AGit always creates a pull request so there is no point is prompting user to create one
hookPrintResult(res.ShouldShowMessage, false, res.HeadBranch, res.URL)
}
}

View File

@ -1356,6 +1356,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
flashError, err := ctx.RenderToHTML(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.push_rejected"),
"Summary": ctx.Tr("repo.pulls.new.blocked_user"),
"Details": "",
})
if err != nil {
ctx.ServerError("CompareAndPullRequest.HTMLString", err)
@ -1366,6 +1367,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
flashError, err := ctx.RenderToHTML(tplAlertDetails, map[string]any{
"Message": ctx.Tr("repo.pulls.push_rejected"),
"Summary": ctx.Tr("repo.pulls.new.must_collaborator"),
"Details": "",
})
if err != nil {
ctx.ServerError("CompareAndPullRequest.HTMLString", err)