diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-28 17:34:07 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-28 17:34:07 -0400 |
commit | a55941ff833155cba88dbcc957b15c0ddcf07cb4 (patch) | |
tree | dd892998bfb0b25eeb2b6f1d0ea8c8b9a69bf422 /routers | |
parent | 9047cadcd33f95eebafa2f794b895c8406eb80c5 (diff) | |
download | gitea-a55941ff833155cba88dbcc957b15c0ddcf07cb4.tar.gz gitea-a55941ff833155cba88dbcc957b15c0ddcf07cb4.zip |
Add auto-detect home directory
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 12 |
1 files changed, 6 insertions, 6 deletions
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 { |