Commit 3625563b authored by Nick Thomas's avatar Nick Thomas

Merge branch 'reduce-diff-in-groups-update_service' into 'master'

[EE] Reduce diff with CE in Groups::UpdateService

See merge request gitlab-org/gitlab-ee!9426
parents 8bda0a89 62c7d986
......@@ -3,7 +3,6 @@
module Groups
class UpdateService < Groups::BaseService
include UpdateVisibilityLevel
prepend ::EE::Groups::UpdateService # rubocop: disable Cop/InjectEnterpriseEditionModule
def execute
reject_parent_id!
......@@ -12,9 +11,7 @@ module Groups
return false unless valid_share_with_group_lock_change?
# Repository size limit comes as MB from the view
limit = @params.delete(:repository_size_limit)
group.repository_size_limit = Gitlab::Utils.try_megabytes_to_bytes(limit) if limit
before_assignment_hook(group, params)
group.assign_attributes(params)
......@@ -33,6 +30,10 @@ module Groups
private
def before_assignment_hook(group, params)
# overriden in EE
end
def after_update
if group.previous_changes.include?(:visibility_level) && group.private?
# don't enqueue immediately to prevent todos removal in case of a mistake
......@@ -59,3 +60,5 @@ module Groups
end
end
end
Groups::UpdateService.prepend(EE::Groups::UpdateService)
......@@ -17,6 +17,13 @@ module EE
private
override :before_assignment_hook
def before_assignment_hook(group, params)
# Repository size limit comes as MB from the view
limit = params.delete(:repository_size_limit)
group.repository_size_limit = ::Gitlab::Utils.try_megabytes_to_bytes(limit) if limit
end
def changes_file_template_project_id?
return false unless params.key?(:file_template_project_id)
......
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