FIX: Polls didn't work in imported posts

Imports skip validation of posts, but polls are only created during the validation phase.
This commit is contained in:
Gerhard Schlager
2019-01-02 15:24:13 +01:00
parent a474bf966c
commit e8053d6e7d
2 changed files with 4 additions and 3 deletions

View File

@@ -476,7 +476,8 @@ class PostCreator
def save_post
@post.disable_rate_limits! if skip_validations?
saved = @post.save(validate: !skip_validations?)
@post.skip_validation = skip_validations?
saved = @post.save
rollback_from_errors!(@post) unless saved
end