about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-05 11:27:58 +0100
committerGitHub <noreply@github.com>2019-01-05 11:27:58 +0100
commitb17b2f25acc4d0cd4284835f28364451cb2fcd88 (patch)
treeacd1c1ca6646f3f8427d8e359b04e85028cbb849 /app/workers
parentfae32634b15a29e66d5c2a04015f2f947cf54627 (diff)
Follow new account before unfollowing the old one during move (#9719)
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/unfollow_follow_worker.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/unfollow_follow_worker.rb b/app/workers/unfollow_follow_worker.rb
index a2133bb8c..50d3bf034 100644
--- a/app/workers/unfollow_follow_worker.rb
+++ b/app/workers/unfollow_follow_worker.rb
@@ -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