Browse Source

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
pull/4/head
Eugen Rochko 5 years ago
committed by GitHub
parent
commit
68833a50d4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      app/services/update_account_service.rb

+ 6
- 3
app/services/update_account_service.rb View File

@ -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

Loading…
Cancel
Save