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:
authorGabriel Mazetto <brodock@gmail.com>2017-08-21 16:28:07 +0300
committerGabriel Mazetto <brodock@gmail.com>2017-08-22 07:33:20 +0300
commitfb9e059a412d95ee3b7442a472ecfd9c67eafd7b (patch)
tree4e8c7790296335f28f6bbaa63f9078360fbea37c /app/services/users
parent02737b8508eb3cce6d8c5ece1f2ffb4772c609a5 (diff)
Make sure repository's removal work for legacy and hashed storages
Diffstat (limited to 'app/services/users')
-rw-r--r--app/services/users/destroy_service.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/users/destroy_service.rb b/app/services/users/destroy_service.rb
index 9d7237c2fbb..8e20de8dfa5 100644
--- a/app/services/users/destroy_service.rb
+++ b/app/services/users/destroy_service.rb
@@ -35,16 +35,18 @@ module Users
Groups::DestroyService.new(group, current_user).execute
end
+ namespace = user.namespace
+ namespace.prepare_for_destroy
+
user.personal_projects.each do |project|
# Skip repository removal because we remove directory with namespace
# that contain all this repositories
- ::Projects::DestroyService.new(project, current_user, skip_repo: true).execute
+ ::Projects::DestroyService.new(project, current_user, skip_repo: project.legacy_storage?).execute
end
MigrateToGhostUserService.new(user).execute unless options[:hard_delete]
# Destroy the namespace after destroying the user since certain methods may depend on the namespace existing
- namespace = user.namespace
user_data = user.destroy
namespace.really_destroy!