Repository level enable package or disable (#19323)

This commit is contained in:
Lunny Xiao 2022-05-08 23:51:50 +08:00 committed by GitHub
parent 6a969681cd
commit d4834071da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 65 additions and 4 deletions

View file

@ -456,6 +456,15 @@ func SettingsPost(ctx *context.Context) {
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypeProjects)
}
if form.EnablePackages && !unit_model.TypeProjects.UnitGlobalDisabled() {
units = append(units, repo_model.RepoUnit{
RepoID: repo.ID,
Type: unit_model.TypePackages,
})
} else if !unit_model.TypePackages.UnitGlobalDisabled() {
deleteUnitTypes = append(deleteUnitTypes, unit_model.TypePackages)
}
if form.EnablePulls && !unit_model.TypePullRequests.UnitGlobalDisabled() {
units = append(units, repo_model.RepoUnit{
RepoID: repo.ID,