Respect feature settings submitted via api
This commit is contained in:
parent
42dc33e9dd
commit
bffa1e6575
1 changed files with 12 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue