mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: when admin is deleted, make it clear in staff action logs when records belong to a deleted user and show their username in the details
This commit is contained in:
@@ -49,6 +49,17 @@ class UserDestroyer
|
||||
post_action.remove_act!(Discourse.system_user)
|
||||
end
|
||||
|
||||
# Add info about the user to staff action logs
|
||||
UserHistory.staff_action_records(
|
||||
Discourse.system_user, acting_user: user.username
|
||||
).each do |log|
|
||||
log.details ||= ''
|
||||
log.details = (log.details.split("\n") +
|
||||
["user_id: #{user.id}", "username: #{user.username}"]
|
||||
).join("\n")
|
||||
log.save!
|
||||
end
|
||||
|
||||
# keep track of emails used
|
||||
user_emails = user.user_emails.pluck(:email)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user