Commit bffa1e65 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Respect feature settings submitted via api

parent 42dc33e9
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment