diff options
author | Stan Hu <stanhu@gmail.com> | 2017-04-16 18:21:40 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-04-16 18:36:33 +0300 |
commit | 60eee739f040e997d6dac3f4e21ef90daa6c7f30 (patch) | |
tree | ad09acc17c462ffeb1337d819dbaf7ba50d2a32e /app | |
parent | 309bab431075eabfb7a01300f946ce9eb5b6fb98 (diff) |
Hard delete users' associated records deleted from AbuseReports
In the case of spammers, we really want a hard delete to avoid retaining spam.
Closes #31021
Diffstat (limited to 'app')
-rw-r--r-- | app/models/abuse_report.rb | 2 | ||||
-rw-r--r-- | app/services/users/destroy_service.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb index 2340453831e..0d7c2d20029 100644 --- a/app/models/abuse_report.rb +++ b/app/models/abuse_report.rb @@ -16,7 +16,7 @@ class AbuseReport < ActiveRecord::Base def remove_user(deleted_by:) user.block - DeleteUserWorker.perform_async(deleted_by.id, user.id, delete_solo_owned_groups: true) + DeleteUserWorker.perform_async(deleted_by.id, user.id, delete_solo_owned_groups: true, hard_delete: true) end def notify diff --git a/app/services/users/destroy_service.rb b/app/services/users/destroy_service.rb index ba58b174cc0..9eb6a600f6b 100644 --- a/app/services/users/destroy_service.rb +++ b/app/services/users/destroy_service.rb @@ -26,7 +26,7 @@ module Users ::Projects::DestroyService.new(project, current_user, skip_repo: true).execute end - MigrateToGhostUserService.new(user).execute + 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 |