]> cat aescling's git repositories - mastodon.git/commitdiff
Follow new account before unfollowing the old one during move (#9719)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 5 Jan 2019 10:27:58 +0000 (11:27 +0100)
committerGitHub <noreply@github.com>
Sat, 5 Jan 2019 10:27:58 +0000 (11:27 +0100)
app/workers/unfollow_follow_worker.rb

index a2133bb8cfc585f61c566ee1a6d003e3ee79978b..50d3bf034adfb9acd9713465f921a7b6ffc245ef 100644 (file)
@@ -10,9 +10,9 @@ class UnfollowFollowWorker
     old_target_account = Account.find(old_target_account_id)
     new_target_account = Account.find(new_target_account_id)
 
-    UnfollowService.new.call(follower_account, old_target_account)
     FollowService.new.call(follower_account, new_target_account)
-  rescue ActiveRecord::RecordNotFound
+    UnfollowService.new.call(follower_account, old_target_account)
+  rescue ActiveRecord::RecordNotFound, Mastodon::NotPermittedError
     true
   end
 end