diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index 6714294e2b66e..8a22db0445c64 100644 --- a/models/fixtures/repo_unit.yml +++ b/models/fixtures/repo_unit.yml @@ -520,7 +520,6 @@ id: 75 repo_id: 1 type: 8 - config: "{\"ProjectsMode\":\"all\"}" created_unix: 946684810 - diff --git a/models/repo/repo.go b/models/repo/repo.go index ad2e21b66b658..f6758f1591ac6 100644 --- a/models/repo/repo.go +++ b/models/repo/repo.go @@ -412,9 +412,11 @@ func (repo *Repository) MustGetUnit(ctx context.Context, tp unit.Type) *RepoUnit Config: new(ActionsConfig), } } else if tp == unit.TypeProjects { + cfg := new(ProjectsConfig) + cfg.ProjectsMode = ProjectsModeNone return &RepoUnit{ Type: tp, - Config: new(ProjectsConfig), + Config: cfg, } } diff --git a/models/repo/repo_unit.go b/models/repo/repo_unit.go index 6b9dde7fafb33..5a841f4d312e8 100644 --- a/models/repo/repo_unit.go +++ b/models/repo/repo_unit.go @@ -236,7 +236,7 @@ func (cfg *ProjectsConfig) GetProjectsMode() ProjectsMode { return cfg.ProjectsMode } - return ProjectsModeNone + return ProjectsModeAll } func (cfg *ProjectsConfig) IsProjectsAllowed(m ProjectsMode) bool { diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 376cfe7607370..0de42b34ea898 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -460,19 +460,19 @@