Commit a6e36672 authored by Robert Speicher's avatar Robert Speicher

Bring CE-EE parity to app/services/projects/update_service.rb

parent ce902b95
......@@ -5,18 +5,10 @@ module Projects
prepend ::EE::Projects::UpdateService
def execute
# Repository size limit comes as MB from the view
limit = params.delete(:repository_size_limit)
project.repository_size_limit = Gitlab::Utils.try_megabytes_to_bytes(limit) if limit
unless valid_visibility_level_change?(project, params[:visibility_level])
return error('New visibility level not allowed!')
end
if changing_storage_size?
project.change_repository_storage(params.delete(:repository_storage))
end
if renaming_project_with_container_registry_tags?
return error('Cannot rename project because it contains container registry tags!')
end
......
......@@ -16,6 +16,14 @@ module EE
should_remove_old_approvers = params.delete(:remove_old_approvers)
wiki_was_enabled = project.wiki_enabled?
# Repository size limit comes as MB from the view
limit = params.delete(:repository_size_limit)
project.repository_size_limit = ::Gitlab::Utils.try_megabytes_to_bytes(limit) if limit
if changing_storage_size?
project.change_repository_storage(params.delete(:repository_storage))
end
result = super
if result[:status] == :success
......
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