Skip to content

Commit d11bf78

Browse files
committed
add release unit enable check
1 parent 536ec4a commit d11bf78

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routers/web/repo/view.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,10 @@ func renderLanguageStats(ctx *context.Context) {
888888
}
889889

890890
func renderLatestRelease(ctx *context.Context) {
891+
if !ctx.Repo.Repository.UnitEnabled(ctx, unit_model.TypeReleases) || unit_model.TypeReleases.UnitGlobalDisabled() {
892+
return
893+
}
894+
891895
release, err := repo_model.GetLatestReleaseByRepoID(ctx, ctx.Repo.Repository.ID)
892896
if err != nil && !repo_model.IsErrReleaseNotExist(err) {
893897
ctx.ServerError("GetLatestReleaseByRepoID", err)

0 commit comments

Comments
 (0)