diff options
author | zeripath <art27@cantab.net> | 2020-10-21 00:50:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 19:50:10 -0400 |
commit | 965861043ae4daf7ae50460edf5533e52980bdb1 (patch) | |
tree | 5b4ecf5e4ce21195e5cb5c449c98ee82a170d005 /routers/repo/branch.go | |
parent | 48a80096bbc7bb4b0fef487df8f176c08f0bf609 (diff) | |
download | gitea-965861043ae4daf7ae50460edf5533e52980bdb1.tar.gz gitea-965861043ae4daf7ae50460edf5533e52980bdb1.zip |
Return the full rejection message and errors in flash errors (#13221)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/repo/branch.go')
-rw-r--r-- | routers/repo/branch.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 0ca77cbf6f..cd18f66777 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -355,7 +355,16 @@ func CreateBranch(ctx *context.Context, form auth.NewBranchForm) { if len(e.Message) == 0 { ctx.Flash.Error(ctx.Tr("repo.editor.push_rejected_no_message")) } else { - ctx.Flash.Error(ctx.Tr("repo.editor.push_rejected", utils.SanitizeFlashErrorString(e.Message))) + flashError, err := ctx.HTMLString(string(tplAlertDetails), map[string]interface{}{ + "Message": ctx.Tr("repo.editor.push_rejected"), + "Summary": ctx.Tr("repo.editor.push_rejected_summary"), + "Details": utils.SanitizeFlashErrorString(e.Message), + }) + if err != nil { + ctx.ServerError("UpdatePullRequest.HTMLString", err) + return + } + ctx.Flash.Error(flashError) } ctx.Redirect(ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()) return |