From a55941ff833155cba88dbcc957b15c0ddcf07cb4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 28 Mar 2014 17:34:07 -0400 Subject: Add auto-detect home directory --- routers/repo/issue.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'routers') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index c3d1a0d960..6ac8a53579 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -231,6 +231,12 @@ func Comment(ctx *middleware.Context, params martini.Params) { return } + content := ctx.Query("content") + if len(content) == 0 { + ctx.Redirect(fmt.Sprintf("/%s/%s/issues/%d", ctx.User.Name, ctx.Repo.Repository.Name, index)) + return + } + issue, err := models.GetIssueByIndex(ctx.Repo.Repository.Id, int64(index)) if err != nil { if err == models.ErrIssueNotExist { @@ -241,12 +247,6 @@ func Comment(ctx *middleware.Context, params martini.Params) { return } - content := ctx.Query("content") - if len(content) == 0 { - ctx.Handle(404, "issue.Comment", err) - return - } - switch params["action"] { case "new": if err = models.CreateComment(ctx.User.Id, issue.Id, 0, 0, content); err != nil { -- cgit v1.2.3