Fix release counter on API repository info (#10968)
Use the same mechanism as the webpage for calculating the release count Fix #10946
This commit is contained in:
parent
ef89e75d0e
commit
ad31d6b5e8
4 changed files with 25 additions and 7 deletions
|
@ -439,7 +439,7 @@ func RepoAssignment() macaron.Handler {
|
|||
ctx.Data["RepoExternalIssuesLink"] = unit.ExternalTrackerConfig().ExternalTrackerURL
|
||||
}
|
||||
|
||||
count, err := models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
|
||||
ctx.Data["NumReleases"], err = models.GetReleaseCountByRepoID(ctx.Repo.Repository.ID, models.FindReleasesOptions{
|
||||
IncludeDrafts: false,
|
||||
IncludeTags: true,
|
||||
})
|
||||
|
@ -447,7 +447,6 @@ func RepoAssignment() macaron.Handler {
|
|||
ctx.ServerError("GetReleaseCountByRepoID", err)
|
||||
return
|
||||
}
|
||||
ctx.Repo.Repository.NumReleases = int(count)
|
||||
|
||||
ctx.Data["Title"] = owner.Name + "/" + repo.Name
|
||||
ctx.Data["Repository"] = repo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue