1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Let not-logged-in users view releases (#1999)

This commit is contained in:
Ethan Koenig
2017-06-17 23:38:24 -04:00
committed by Lunny Xiao
parent 6e452c4da7
commit 4df1a24096
3 changed files with 17 additions and 4 deletions

View File

@@ -79,7 +79,10 @@ func Releases(ctx *context.Context) {
// Temporary cache commits count of used branches to speed up.
countCache := make(map[string]int64)
cacheUsers := map[int64]*models.User{ctx.User.ID: ctx.User}
cacheUsers := make(map[int64]*models.User)
if ctx.User != nil {
cacheUsers[ctx.User.ID] = ctx.User
}
var ok bool
releasesToDisplay := make([]*models.Release, 0, len(releases))