Add missing contexts when destroying users
This commit is contained in:
parent
acdfb3ed03
commit
4addc5e329
|
@ -387,7 +387,14 @@ class Admin::UsersController < Admin::AdminController
|
||||||
params.require(:order)
|
params.require(:order)
|
||||||
|
|
||||||
user_destroyer = UserDestroyer.new(current_user)
|
user_destroyer = UserDestroyer.new(current_user)
|
||||||
options = { delete_posts: true, block_email: true, block_urls: true, block_ip: true, delete_as_spammer: true }
|
options = {
|
||||||
|
delete_posts: true,
|
||||||
|
block_email: true,
|
||||||
|
block_urls: true,
|
||||||
|
block_ip: true,
|
||||||
|
delete_as_spammer: true,
|
||||||
|
context: I18n.t("user.destroy_reasons.same_ip_address", ip_address: params[:ip])
|
||||||
|
}
|
||||||
|
|
||||||
AdminUserIndexQuery.new(params).find_users(50).each do |user|
|
AdminUserIndexQuery.new(params).find_users(50).each do |user|
|
||||||
user_destroyer.destroy(user, options) rescue nil
|
user_destroyer.destroy(user, options) rescue nil
|
||||||
|
|
|
@ -20,7 +20,7 @@ module Jobs
|
||||||
user.posts.each do |post|
|
user.posts.each do |post|
|
||||||
post.set_owner(original_user, acting_user)
|
post.set_owner(original_user, acting_user)
|
||||||
end
|
end
|
||||||
destroyer.destroy(user)
|
destroyer.destroy(user, context: I18n.t("user.destroy_reasons.fixed_primary_email"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ module Jobs
|
||||||
.find_each do |user|
|
.find_each do |user|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
destroyer.destroy(user)
|
destroyer.destroy(user, context: I18n.t("user.destroy_reasons.unused_staged_user"))
|
||||||
rescue => e
|
rescue => e
|
||||||
Discourse.handle_job_exception(e,
|
Discourse.handle_job_exception(e,
|
||||||
message: "Cleaning up unused staged user",
|
message: "Cleaning up unused staged user",
|
||||||
|
|
|
@ -1770,6 +1770,10 @@ en:
|
||||||
website:
|
website:
|
||||||
domain_not_allowed: "Website is invalid. Allowed domains are: %{domains}"
|
domain_not_allowed: "Website is invalid. Allowed domains are: %{domains}"
|
||||||
auto_rejected: "Rejected automatically due to age. See auto_handle_queued_age site setting."
|
auto_rejected: "Rejected automatically due to age. See auto_handle_queued_age site setting."
|
||||||
|
destroy_reasons:
|
||||||
|
unused_staged_user: "Unused staged user"
|
||||||
|
fixed_primary_email: "Fixed primary email for staged user"
|
||||||
|
same_ip_address: "Same IP address (%ip_address%) as other users"
|
||||||
|
|
||||||
flags_reminder:
|
flags_reminder:
|
||||||
flags_were_submitted:
|
flags_were_submitted:
|
||||||
|
|
Loading…
Reference in New Issue