diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2017-08-21 15:28:07 +0200 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2017-08-22 06:33:20 +0200 |
commit | fb9e059a412d95ee3b7442a472ecfd9c67eafd7b (patch) | |
tree | 4e8c7790296335f28f6bbaa63f9078360fbea37c /app/services/users | |
parent | 02737b8508eb3cce6d8c5ece1f2ffb4772c609a5 (diff) | |
download | gitlab-ce-fb9e059a412d95ee3b7442a472ecfd9c67eafd7b.tar.gz |
Make sure repository's removal work for legacy and hashed storages28283-uuid-storage
Diffstat (limited to 'app/services/users')
-rw-r--r-- | app/services/users/destroy_service.rb | 6 |
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! |