Skip to content

Commit

Permalink
Fix VerifyAccountLinksWorker not being queued
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Gargron committed Sep 18, 2018
1 parent bac8227 commit 0b6af23
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/services/update_account_service.rb
Expand Up @@ -9,16 +9,19 @@ def call(account, params, raise_error: false)
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

0 comments on commit 0b6af23

Please sign in to comment.