diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-31 21:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-31 21:09:19 +0300 |
commit | 676109e1b32682bdbdd94a9ffbd8743784f35521 (patch) | |
tree | 71f0394c68455c1736a14c215992de6aa5fe358c /app/services | |
parent | 5facc34f44ce8736078127a5df174a7b52d922b4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/members/invite_service.rb | 14 | ||||
-rw-r--r-- | app/services/projects/unlink_fork_service.rb | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/app/services/members/invite_service.rb b/app/services/members/invite_service.rb index db29f41d5f6..b865babdf3c 100644 --- a/app/services/members/invite_service.rb +++ b/app/services/members/invite_service.rb @@ -10,13 +10,14 @@ module Members @errors = {} @emails = params[:email]&.split(',')&.uniq&.flatten + @source = params[:source] end - def execute(source) - @source = source + def execute validate_emails! emails.each(&method(:process_email)) + enqueue_onboarding_progress_action result rescue BlankEmailsError, TooManyEmailsError => e error(e.message) @@ -24,7 +25,7 @@ module Members private - attr_reader :source, :errors, :emails + attr_reader :source, :errors, :emails, :member_created_namespace_id def validate_emails! raise BlankEmailsError, s_('AddMember|Email cannot be blank') if emails.blank? @@ -88,6 +89,7 @@ module Members errors[email] = new_member.errors.full_messages.to_sentence else after_execute(member: new_member) + @member_created_namespace_id ||= new_member.namespace_id end end @@ -98,6 +100,12 @@ module Members success end end + + def enqueue_onboarding_progress_action + return unless member_created_namespace_id + + Namespaces::OnboardingUserAddedWorker.perform_async(member_created_namespace_id) + end end end diff --git a/app/services/projects/unlink_fork_service.rb b/app/services/projects/unlink_fork_service.rb index 6ba3356d612..91632e50ba8 100644 --- a/app/services/projects/unlink_fork_service.rb +++ b/app/services/projects/unlink_fork_service.rb @@ -32,6 +32,8 @@ module Projects if fork_network = @project.root_of_fork_network fork_network.update(root_project: nil, deleted_root_project_name: @project.full_name) end + + @project.leave_pool_repository end # rubocop: disable Cop/InBatches |