summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-15 02:48:05 +0800
committerUnknwon <u@gogs.io>2015-08-15 02:48:05 +0800
commit30b428bf0eabb9f6cd73894d776502e1b7e351b7 (patch)
treec7e51f33011d5813374f9d90c6e4c5fef3f79cbb /routers/repo/issue.go
parente4d6b5d488981d78417e9c85eda8226ebb8b7e37 (diff)
downloadgitea-30b428bf0eabb9f6cd73894d776502e1b7e351b7.tar.gz
gitea-30b428bf0eabb9f6cd73894d776502e1b7e351b7.zip
#1419: 500 when visit a issue with issue/comments of deleted user
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index d992cecc53..dc86dedff0 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -508,7 +508,7 @@ func ViewIssue(ctx *middleware.Context) {
}
ctx.Data["Issue"] = issue
- // ctx.Data["IsIssueOwner"] = ctx.Repo.IsOwner() || (ctx.IsSigned && issue.PosterID == ctx.User.Id)
+ ctx.Data["IsIssueOwner"] = ctx.Repo.IsAdmin() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id))
ctx.HTML(200, ISSUE_VIEW)
}
@@ -685,7 +685,7 @@ func NewComment(ctx *middleware.Context, form auth.CreateCommentForm) {
}
// Check if issue owner/poster changes the status of issue.
- if (ctx.Repo.IsOwner() || issue.IsPoster(ctx.User.Id)) &&
+ if (ctx.Repo.IsOwner() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id))) &&
(form.Status == "reopen" || form.Status == "close") {
issue.Repo = ctx.Repo.Repository
if err = issue.ChangeStatus(ctx.User, form.Status == "close"); err != nil {