Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-28 03:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-28 03:09:08 +0300
commitf54a50aa826d0eedcf2e56f51462613bc132f826 (patch)
tree7194aca23f9af822ea55966a6f477b3d8d68ee47 /app/services/users
parentc77fda905a8619b756163c10a75171dc9cfe7084 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/users')
-rw-r--r--app/services/users/destroy_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/users/destroy_service.rb b/app/services/users/destroy_service.rb
index ef79ee3d06e..587a8516394 100644
--- a/app/services/users/destroy_service.rb
+++ b/app/services/users/destroy_service.rb
@@ -56,10 +56,13 @@ module Users
MigrateToGhostUserService.new(user).execute unless options[:hard_delete]
+ response = Snippets::BulkDestroyService.new(current_user, user.snippets).execute
+ raise DestroyError, response.message if response.error?
+
# Rails attempts to load all related records into memory before
# destroying: https://github.com/rails/rails/issues/22510
# This ensures we delete records in batches.
- user.destroy_dependent_associations_in_batches
+ user.destroy_dependent_associations_in_batches(exclude: [:snippets])
# Destroy the namespace after destroying the user since certain methods may depend on the namespace existing
user_data = user.destroy