From c84652eb8b2bb9dd616056621ee7c7b91fcf64a2 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Thu, 30 Jan 2020 12:30:11 +1000 Subject: [PATCH] Get rid of no longer needed target_usernames warning log --- app/controllers/posts_controller.rb | 4 ---- lib/topic_creator.rb | 2 -- 2 files changed, 6 deletions(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 534f6924d58..caef113e502 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -777,10 +777,6 @@ class PostsController < ApplicationController result[:target_group_names] = groups.join(",") end - if (recipients.blank? || result[:target_usernames].blank?) && params[:archetype] == Archetype.private_message - Rails.logger.warn("Missing recipients for PM! result: #{result.inspect} | params: #{params.inspect}") - end - result.permit! result.to_h end diff --git a/lib/topic_creator.rb b/lib/topic_creator.rb index 09adf4c2111..5f4aa7f16e9 100644 --- a/lib/topic_creator.rb +++ b/lib/topic_creator.rb @@ -171,8 +171,6 @@ class TopicCreator topic.subtype = TopicSubtype.user_to_user unless topic.subtype unless @opts[:target_usernames].present? || @opts[:target_emails].present? || @opts[:target_group_names].present? - Rails.logger.warn("Topic PM cannot be created without recipients! opts: #{@opts.inspect}") - rollback_with!(topic, :no_user_selected) end