From ca7e9067740bd7919340ae78091418e732980225 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 31 May 2017 17:51:05 +0900 Subject: [PATCH] Skip validations when Discobot creates new posts. --- .../lib/discourse_narrative_bot/actions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb index 6315bb9c90c..a005e6b4ec4 100644 --- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb +++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/actions.rb @@ -11,14 +11,15 @@ module DiscourseNarrativeBot default_opts = { raw: raw, topic_id: post.topic_id, - reply_to_post_number: post.post_number + reply_to_post_number: post.post_number, + skip_validations: true } new_post = PostCreator.create!(self.discobot_user, default_opts.merge(opts)) reset_rate_limits(post) if new_post new_post else - PostCreator.create!(self.discobot_user, { raw: raw }.merge(opts)) + PostCreator.create!(self.discobot_user, { raw: raw, skip_validations: true }.merge(opts)) end end