diff options
author | Robert Speicher <robert@gitlab.com> | 2017-04-18 03:04:20 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-04-18 03:04:20 +0000 |
commit | ec9f6180bc4684521444ee0681308bf4c9c71297 (patch) | |
tree | f940c8ca67a50c92fb6d0c18718731869d6d5253 /app | |
parent | 2b934a7f43feff6889b51a1cd2aadc9afb3f25d8 (diff) | |
parent | fd605619361ce60500c58e5dffbbe8446cc25396 (diff) | |
download | gitlab-ce-ec9f6180bc4684521444ee0681308bf4c9c71297.tar.gz |
Merge branch 'sh-use-delete-worker-spam-logs' into 'master'
Use DeleteUserWorker for removing users via spam logs
See merge request !10725
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/spam_logs_controller.rb | 2 | ||||
-rw-r--r-- | app/models/spam_log.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/admin/spam_logs_controller.rb b/app/controllers/admin/spam_logs_controller.rb index 2abfa22712d..1d66955bb71 100644 --- a/app/controllers/admin/spam_logs_controller.rb +++ b/app/controllers/admin/spam_logs_controller.rb @@ -7,7 +7,7 @@ class Admin::SpamLogsController < Admin::ApplicationController spam_log = SpamLog.find(params[:id]) if params[:remove_user] - spam_log.remove_user + spam_log.remove_user(deleted_by: current_user) redirect_to admin_spam_logs_path, notice: "User #{spam_log.user.username} was successfully removed." else spam_log.destroy diff --git a/app/models/spam_log.rb b/app/models/spam_log.rb index 3b8b9833565..dd21ee15c6c 100644 --- a/app/models/spam_log.rb +++ b/app/models/spam_log.rb @@ -3,9 +3,9 @@ class SpamLog < ActiveRecord::Base validates :user, presence: true - def remove_user + def remove_user(deleted_by:) user.block - user.destroy + DeleteUserWorker.perform_async(deleted_by.id, user.id, delete_solo_owned_groups: true, hard_delete: true) end def text |