mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 13:31:44 +08:00
FIX: Broken spec
This commit is contained in:
parent
6d539c0afd
commit
704ac91a22
|
@ -78,7 +78,6 @@ class PostsController < ApplicationController
|
|||
def create_post(params)
|
||||
post_creator = PostCreator.new(current_user, params)
|
||||
post = post_creator.create
|
||||
DiscourseEvent.trigger(:topic_saved, post.topic, params)
|
||||
|
||||
if post_creator.errors.present?
|
||||
# If the post was spam, flag all the user's posts as spam
|
||||
|
@ -86,6 +85,7 @@ class PostsController < ApplicationController
|
|||
[false, MultiJson.dump(errors: post_creator.errors.full_messages)]
|
||||
|
||||
else
|
||||
DiscourseEvent.trigger(:topic_saved, post.topic, params)
|
||||
post_serializer = PostSerializer.new(post, scope: guardian, root: false)
|
||||
post_serializer.draft_sequence = DraftSequence.current(current_user, post.topic.draft_key)
|
||||
[true, MultiJson.dump(post_serializer)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user