diff options
author | Sergio Benitez <sbenitez@mit.edu> | 2015-09-09 13:44:51 -0700 |
---|---|---|
committer | Sergio Benitez <sbenitez@mit.edu> | 2015-09-09 13:44:51 -0700 |
commit | 964d0262ff353db6a50ed5be83ebd22f71aa6e69 (patch) | |
tree | 8cbab6b6a9b4f62cbe9acb2a0b8752b531633362 /routers/repo/issue.go | |
parent | 079a2d68db5c843ef2dbba65aeca46d5887d6b02 (diff) | |
parent | b75d0378cbbf0523963fd9bc749543244be7392b (diff) |
Merged conflicts.
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r-- | routers/repo/issue.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index e821c130..e242dd0e 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -759,18 +759,6 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) { return } - // Check if issue owner/poster changes the status of issue. - if (ctx.Repo.IsOwner() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id))) && - (form.Status == "reopen" || form.Status == "close") && - !(issue.IsPull && issue.HasMerged) { - issue.Repo = ctx.Repo.Repository - if err = issue.ChangeStatus(ctx.User, form.Status == "close"); err != nil { - ctx.Handle(500, "ChangeStatus", err) - return - } - log.Trace("%s Issue[%d] status changed: %v", ctx.Req.RequestURI, issue.ID, !issue.IsClosed) - } - // Fix #321: Allow empty comments, as long as we have attachments. if len(form.Content) == 0 && len(attachments) == 0 { ctx.Redirect(fmt.Sprintf("%s/issues/%d", ctx.Repo.RepoLink, issue.Index)) @@ -820,8 +808,20 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) { return } } - log.Trace("Comment created: %d/%d/%d", ctx.Repo.Repository.ID, issue.ID, comment.ID) + + // Check if issue owner/poster changes the status of issue. + if (ctx.Repo.IsOwner() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id))) && + (form.Status == "reopen" || form.Status == "close") && + !(issue.IsPull && issue.HasMerged) { + issue.Repo = ctx.Repo.Repository + if err = issue.ChangeStatus(ctx.User, form.Status == "close"); err != nil { + ctx.Handle(500, "ChangeStatus", err) + return + } + log.Trace("Issue[%d] status changed: %v", issue.ID, !issue.IsClosed) + } + ctx.Redirect(fmt.Sprintf("%s/issues/%d#%s", ctx.Repo.RepoLink, issue.Index, comment.HashTag())) } |