Skip validations when Discobot creates new posts.

This commit is contained in:
Guo Xiang Tan 2017-05-31 17:51:05 +09:00
parent b0dd05fdc6
commit ca7e906774
1 changed files with 3 additions and 2 deletions

View File

@ -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