diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-26 17:25:46 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-26 17:25:46 +0400 |
commit | bffa1e657533dcd324042642f30b06dee3f61930 (patch) | |
tree | 7dd15809c0672601d879874ba9272d0f94078a24 /app | |
parent | 42dc33e9dd473aad564fd4b1c3c277fbddf63366 (diff) |
Respect feature settings submitted via api
Diffstat (limited to 'app')
-rw-r--r-- | app/contexts/projects/create_context.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/app/contexts/projects/create_context.rb b/app/contexts/projects/create_context.rb index f044b1eeb6a..2922564ba20 100644 --- a/app/contexts/projects/create_context.rb +++ b/app/contexts/projects/create_context.rb @@ -8,7 +8,18 @@ module Projects # get namespace id namespace_id = params.delete(:namespace_id) - @project = Project.new(params) + # Load default feature settings + default_features = Gitlab.config.gitlab.default_projects_features + + default_opts = { + issues_enabled: default_features.issues, + wiki_enabled: default_features.wiki, + wall_enabled: default_features.wall, + snippets_enabled: default_features.snippets, + merge_requests_enabled: default_features.merge_requests + } + + @project = Project.new(default_opts.merge(params)) # Parametrize path for project # @@ -32,13 +43,6 @@ module Projects @project.namespace_id = current_user.namespace_id end - # Disable less important features by default - @project.issues_enabled = Gitlab.config.gitlab.default_projects_features.issues - @project.wiki_enabled = Gitlab.config.gitlab.default_projects_features.wiki - @project.wall_enabled = Gitlab.config.gitlab.default_projects_features.wall - @project.snippets_enabled = Gitlab.config.gitlab.default_projects_features.snippets - @project.merge_requests_enabled = Gitlab.config.gitlab.default_projects_features.merge_requests - @project.creator = current_user # Import project from cloneable resource |