1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 04:28:21 +00:00

Fix releases to be counted from database not tags (#2389) (#2424)

This commit is contained in:
Lauris BH
2017-08-30 04:31:32 +03:00
committed by Lunny Xiao
parent 1cbe502cc2
commit 0c910afe11
3 changed files with 11 additions and 3 deletions

View File

@@ -275,7 +275,15 @@ func RepoAssignment() macaron.Handler {
return
}
ctx.Data["Tags"] = tags
ctx.Repo.Repository.NumTags = len(tags)
count, err := models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
IncludeDrafts: false,
})
if err != nil {
ctx.Handle(500, "GetReleaseCountByRepoID", err)
return
}
ctx.Repo.Repository.NumReleases = int(count)
ctx.Data["Title"] = owner.Name + "/" + repo.Name
ctx.Data["Repository"] = repo