skip validations for Spam Rules when needed

This commit is contained in:
Sam 2013-12-02 16:13:47 +11:00
parent a2d5a7dbd8
commit 5e0b22365a
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class PostCreator
{ user: @user, { user: @user,
limit_once_per: 24.hours, limit_once_per: 24.hours,
message_params: {domains: @post.linked_hosts.keys.join(', ')} } ) message_params: {domains: @post.linked_hosts.keys.join(', ')} } )
elsif @post && !@post.errors.present? elsif @post && !@post.errors.present? && !@opts[:skip_validations]
SpamRulesEnforcer.enforce!(@post) SpamRulesEnforcer.enforce!(@post)
end end