summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-28 17:34:07 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-28 17:34:07 -0400
commita55941ff833155cba88dbcc957b15c0ddcf07cb4 (patch)
treedd892998bfb0b25eeb2b6f1d0ea8c8b9a69bf422 /routers
parent9047cadcd33f95eebafa2f794b895c8406eb80c5 (diff)
downloadgitea-a55941ff833155cba88dbcc957b15c0ddcf07cb4.tar.gz
gitea-a55941ff833155cba88dbcc957b15c0ddcf07cb4.zip
Add auto-detect home directory
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go12
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 {