From 9f1a662191acce222476d5b3e185a60a6d3125bf Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sat, 9 Mar 2024 18:05:09 +1100 Subject: [PATCH] Allow de-syndication of posts that don't have a target saved --- slices/admin/commands/posts/de_syndicate.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slices/admin/commands/posts/de_syndicate.rb b/slices/admin/commands/posts/de_syndicate.rb index defd179..2921d71 100644 --- a/slices/admin/commands/posts/de_syndicate.rb +++ b/slices/admin/commands/posts/de_syndicate.rb @@ -13,7 +13,11 @@ module Admin request = if target.to_sym == :mastodon masto_id = post.syndication_sources[target].split("/").last - mastodon.de_syndicate(post_id: masto_id) + if masto_id == "" + Success() + else + mastodon.de_syndicate(post_id: masto_id) + end end if request.success?