diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-12-15 14:59:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 14:59:57 +0800 |
commit | 4da1d9781025aa4a85899b1ddeb25aabbaa82703 (patch) | |
tree | 9714f71f2fb042e44d418fbcfc56cd8440a1bbb1 /routers/web/repo/pull.go | |
parent | 9d943bf374e56e4d403303a6a2caafc1c79cdb6f (diff) | |
download | gitea-4da1d9781025aa4a85899b1ddeb25aabbaa82703.tar.gz gitea-4da1d9781025aa4a85899b1ddeb25aabbaa82703.zip |
Refactor HTTP request context (#17979)
Diffstat (limited to 'routers/web/repo/pull.go')
-rw-r--r-- | routers/web/repo/pull.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index f94424870a..9445c1a48b 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -771,7 +771,7 @@ func UpdatePullRequest(ctx *context.Context) { if err = pull_service.Update(issue.PullRequest, ctx.User, message, rebase); err != nil { if models.IsErrMergeConflicts(err) { conflictError := err.(models.ErrMergeConflicts) - flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{ "Message": ctx.Tr("repo.pulls.merge_conflict"), "Summary": ctx.Tr("repo.pulls.merge_conflict_summary"), "Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut), @@ -785,7 +785,7 @@ func UpdatePullRequest(ctx *context.Context) { return } else if models.IsErrRebaseConflicts(err) { conflictError := err.(models.ErrRebaseConflicts) - flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{ "Message": ctx.Tr("repo.pulls.rebase_conflict", utils.SanitizeFlashErrorString(conflictError.CommitSHA)), "Summary": ctx.Tr("repo.pulls.rebase_conflict_summary"), "Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut), @@ -940,7 +940,7 @@ func MergePullRequest(ctx *context.Context) { return } else if models.IsErrMergeConflicts(err) { conflictError := err.(models.ErrMergeConflicts) - flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{ "Message": ctx.Tr("repo.editor.merge_conflict"), "Summary": ctx.Tr("repo.editor.merge_conflict_summary"), "Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut), @@ -954,7 +954,7 @@ func MergePullRequest(ctx *context.Context) { return } else if models.IsErrRebaseConflicts(err) { conflictError := err.(models.ErrRebaseConflicts) - flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{ "Message": ctx.Tr("repo.pulls.rebase_conflict", utils.SanitizeFlashErrorString(conflictError.CommitSHA)), "Summary": ctx.Tr("repo.pulls.rebase_conflict_summary"), "Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut), @@ -983,7 +983,7 @@ func MergePullRequest(ctx *context.Context) { if len(message) == 0 { ctx.Flash.Error(ctx.Tr("repo.pulls.push_rejected_no_message")) } else { - flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{ "Message": ctx.Tr("repo.pulls.push_rejected"), "Summary": ctx.Tr("repo.pulls.push_rejected_summary"), "Details": utils.SanitizeFlashErrorString(pushrejErr.Message), @@ -1143,7 +1143,7 @@ func CompareAndPullRequestPost(ctx *context.Context) { if len(message) == 0 { ctx.Flash.Error(ctx.Tr("repo.pulls.push_rejected_no_message")) } else { - flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + flashError, err := ctx.RenderToString(tplAlertDetails, map[string]interface{}{ "Message": ctx.Tr("repo.pulls.push_rejected"), "Summary": ctx.Tr("repo.pulls.push_rejected_summary"), "Details": utils.SanitizeFlashErrorString(pushrejErr.Message), |