Fix scheduled toot with media immediately creating a toot (#9894)
* Add test for not persisting status when attaching media to scheduled toot * Prevent status used for validation from being persisted to the database Fixes #9893 Thanks to tateisu for the help investigating this.
This commit is contained in:
parent
dd8a00a3cc
commit
061feb63ed
2 changed files with 18 additions and 1 deletions
|
@ -66,7 +66,10 @@ class PostStatusService < BaseService
|
|||
end
|
||||
|
||||
def schedule_status!
|
||||
if @account.statuses.build(status_attributes).valid?
|
||||
status_for_validation = @account.statuses.build(status_attributes)
|
||||
if status_for_validation.valid?
|
||||
status_for_validation.destroy
|
||||
|
||||
# The following transaction block is needed to wrap the UPDATEs to
|
||||
# the media attachments when the scheduled status is created
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue