mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
FIX: Clear drafts only when post is created by real user (#15720)
This commits adds a new advance_draft to PostCreator that controls if the draft sequence will be advanced or not. If the draft sequence is advanced then the old drafts will be cleared. This used to happen for posts created by plugins or through the API and cleared user drafts by mistake.
This commit is contained in:
@ -182,6 +182,7 @@ class PostsController < ApplicationController
|
||||
def create
|
||||
@manager_params = create_params
|
||||
@manager_params[:first_post_checks] = !is_api?
|
||||
@manager_params[:advance_draft] = !is_api?
|
||||
|
||||
manager = NewPostManager.new(current_user, @manager_params)
|
||||
|
||||
|
Reference in New Issue
Block a user