diff --git a/app/services/staff_action_logger.rb b/app/services/staff_action_logger.rb index 4793424b7bf..fdfc7f200b3 100644 --- a/app/services/staff_action_logger.rb +++ b/app/services/staff_action_logger.rb @@ -65,10 +65,12 @@ class StaffActionLogger def log_topic_deletion(deleted_topic, opts={}) raise Discourse::InvalidParameters.new(:deleted_topic) unless deleted_topic && deleted_topic.is_a?(Topic) + user = delete_topic.user ? "#{deleted_topic.user.username} (#{deleted_topic.user.name})" : "(deleted user)" + details = [ "id: #{deleted_topic.id}", "created_at: #{deleted_topic.created_at}", - "user: #{deleted_topic.user.username} (#{deleted_topic.user.name})", + "user: #{user}", "title: #{deleted_topic.title}" ]