diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-09-18 23:57:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 23:57:21 +0200 |
commit | 68833a50d4f9952c9073c15bd13510048951d685 (patch) | |
tree | b5e9cdd9ab734aea4603ef828bf6f56ea4d7a911 /app | |
parent | bac8227519ac0040f79c698c0bd6903427c61c51 (diff) |
Fix VerifyAccountLinksWorker not being queued (#8721)
UX-wise, people expect that saving the profile will re-check links even without changing fields content. Bug-wise, `@account` was undefined. Regression from #8703
Diffstat (limited to 'app')
-rw-r--r-- | app/services/update_account_service.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/services/update_account_service.rb b/app/services/update_account_service.rb index 362d80c9e..ec69d944a 100644 --- a/app/services/update_account_service.rb +++ b/app/services/update_account_service.rb @@ -9,16 +9,19 @@ class UpdateAccountService < BaseService next unless ret authorize_all_follow_requests(account) if was_locked && !account.locked - VerifyAccountLinksWorker.perform_async(@account.id) if account.fields_changed? + check_links(account) end end private def authorize_all_follow_requests(account) - follow_requests = FollowRequest.where(target_account: account) - AuthorizeFollowWorker.push_bulk(follow_requests) do |req| + AuthorizeFollowWorker.push_bulk(FollowRequest.where(target_account: account).select(:account_id, :target_account_id)) do |req| [req.account_id, req.target_account_id] end end + + def check_links(account) + VerifyAccountLinksWorker.perform_async(account.id) + end end |