A platform for community discussion. Free, open, simple.
FIX: Set unique post key for a user outside of transaction.
Guo Xiang Tanec27db78bec4
diff --git a/lib/post_creator.rb b/lib/post_creator.rbindex 173a30cf20b..4c4c0793256 100644--- a/lib/post_creator.rb+++ b/lib/post_creator.rb@@ -167,7 +167,6 @@ class PostCreatorcreate_topicsave_postextract_links- store_unique_post_keytrack_topicupdate_topic_statsupdate_topic_auto_close@@ -182,6 +181,7 @@ class PostCreatorendif @post && errors.blank? && !@opts[:import_mode]+ store_unique_post_key# update counters etc.@post.topic.reloaddiff --git a/spec/components/post_creator_spec.rb b/spec/components/post_creator_spec.rbindex 304491c59cc..8774c6402e9 100644--- a/spec/components/post_creator_spec.rb+++ b/spec/components/post_creator_spec.rb@@ -580,8 +580,9 @@ describe PostCreator doit "returns blank for another post with the same content" docreator.create- new_post_creator.create- expect(new_post_creator.errors).to be_present+ post = new_post_creator.create++ expect(post.errors[:raw]).to include(I18n.t(:just_posted_that))endit "returns a post for admins" do