From ba1b840816e1c6ee831d58bd3f17e548e957bfd2 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Wed, 11 Mar 2020 18:27:37 +0100 Subject: [PATCH] DEV: Don't deactivate suspended users during import Otherwise a cleanup job might delete those deactivated users. --- script/import_scripts/base.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index c827bc5e7ec..2d527598226 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -367,8 +367,6 @@ class ImportScripts::Base if u.custom_fields['import_email'] u.suspended_at = Time.zone.at(Time.now) u.suspended_till = 200.years.from_now - ban_reason = 'Invalid email address on import' - u.active = false u.save! user_option = u.user_option @@ -377,7 +375,7 @@ class ImportScripts::Base user_option.email_messages_level = UserOption.email_level_types[:never] user_option.save! if u.save - StaffActionLogger.new(Discourse.system_user).log_user_suspend(u, ban_reason) + StaffActionLogger.new(Discourse.system_user).log_user_suspend(u, 'Invalid email address on import') else Rails.logger.error("Failed to suspend user #{u.username}. #{u.errors.try(:full_messages).try(:inspect)}") end