aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-06 20:42:30 +0200
committerGitHub <noreply@github.com>2020-04-06 19:42:30 +0100
commitad31d6b5e8856b22ddad45477be9d078a869a953 (patch)
tree63a8e832f97b50aee3bef9321fa5f238b0c0e8d4 /modules/context
parentef89e75d0eb232e98ca7a7ef278b8681c7f4fe50 (diff)
downloadgitea-ad31d6b5e8856b22ddad45477be9d078a869a953.tar.gz
gitea-ad31d6b5e8856b22ddad45477be9d078a869a953.zip
Fix release counter on API repository info (#10968)
Use the same mechanism as the webpage for calculating the release count Fix #10946
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/repo.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 1f6e5037cc..841dcd960e 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -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