提交 c29c0b30 编写于 作者: J James Lopez

Merge branch 'sh-fix-update-service' into 'master'

Fix Error 500 when updating a project

Closes #44019

See merge request gitlab-org/gitlab-ce!17647
......@@ -58,7 +58,7 @@ module Projects
def enabling_wiki?
return false if @project.wiki_enabled?
params[:project_feature_attributes][:wiki_access_level].to_i > ProjectFeature::DISABLED
params.dig(:project_feature_attributes, :wiki_access_level).to_i > ProjectFeature::DISABLED
end
def ensure_wiki_exists
......
......@@ -132,6 +132,15 @@ describe Projects::UpdateService do
expect(result).to eq({ status: :success })
expect(project.wiki_repository_exists?).to be false
end
it 'handles empty project feature attributes' do
project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED)
result = update_project(project, user, { name: 'test1' })
expect(result).to eq({ status: :success })
expect(project.wiki_repository_exists?).to be false
end
end
context 'when enabling a wiki' do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册