diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-02-03 02:22:39 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-03 15:22:39 +0800 |
commit | 68bdaf0a6b712b522dd465f72a32195f410134a3 (patch) | |
tree | b79537b39b0c4fa1a57a1d86177d1d7233cdb862 /routers | |
parent | 400b6fd61c6a1cea590c1b264b588d9a2b0cae28 (diff) | |
download | gitea-68bdaf0a6b712b522dd465f72a32195f410134a3.tar.gz gitea-68bdaf0a6b712b522dd465f72a32195f410134a3.zip |
Drop redundant columns from issue_user table (#638)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 76440359ef..a5ec136bee 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -213,26 +213,14 @@ func Issues(ctx *context.Context) { } } - // Get issue-user relations. - pairs, err := models.GetIssueUsers(repo.ID, posterID, isShowClosed) - if err != nil { - ctx.Handle(500, "GetIssueUsers", err) - return - } - // Get posters. for i := range issues { + // Check read status if !ctx.IsSigned { issues[i].IsRead = true - continue - } - - // Check read status. - idx := models.PairsContains(pairs, issues[i].ID, ctx.User.ID) - if idx > -1 { - issues[i].IsRead = pairs[idx].IsRead - } else { - issues[i].IsRead = true + } else if err = issues[i].GetIsRead(ctx.User.ID); err != nil { + ctx.Handle(500, "GetIsRead", err) + return } } ctx.Data["Issues"] = issues |