diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index 6714294e2..8a22db044 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 ad2e21b66..f6758f159 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 6b9dde7fa..5a841f4d3 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 376cfe760..0de42b34e 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -460,19 +460,19 @@