about summary refs log tree commit diff
path: root/app/services/post_status_service.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-01-25 22:42:21 +0100
committerGitHub <noreply@github.com>2019-01-25 22:42:21 +0100
commit270bf7778d681453b259e54b5da55fb449365c8b (patch)
treef94f595aa4347572fe7a62488c8bc90d56f94d2f /app/services/post_status_service.rb
parentafec6b43eb856547ccc7083dbb677096d78821bf (diff)
parent8ef0498f1ca4ff4dab7d8255f15577a86907c392 (diff)
Merge pull request #896 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/post_status_service.rb')
-rw-r--r--app/services/post_status_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 68cffe915..e4b61ee35 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -69,7 +69,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