diff options
author | Brecht Van Lommel <brecht@blender.org> | 2023-02-01 02:31:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-01 01:31:19 +0000 |
commit | faa96553d1dd5487b8d3682c8eac100580b321e3 (patch) | |
tree | 15a7a0d4ef006c48c19bef8ce1a6295ef67da16f /routers/web | |
parent | b6145bfaa348cb90364837a0fa86421d26f93463 (diff) | |
download | gitea-faa96553d1dd5487b8d3682c8eac100580b321e3.tar.gz gitea-faa96553d1dd5487b8d3682c8eac100580b321e3.zip |
Add repository setting to enable/disable releases unit (#22671)
To go along with similar settings for issues, pulls, projects, packages.
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/repo/setting.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index d2d15537ac..73887195e6 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -488,6 +488,15 @@ func SettingsPost(ctx *context.Context) { deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeProjects) } + if form.EnableReleases && !unit_model.TypeReleases.UnitGlobalDisabled() { + units = append(units, repo_model.RepoUnit{ + RepoID: repo.ID, + Type: unit_model.TypeReleases, + }) + } else if !unit_model.TypeReleases.UnitGlobalDisabled() { + deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeReleases) + } + if form.EnablePackages && !unit_model.TypePackages.UnitGlobalDisabled() { units = append(units, repo_model.RepoUnit{ RepoID: repo.ID, |