forked from treehouse/mastodon
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 #8703signup-info-prompt
parent
bac8227519
commit
68833a50d4
|
@ -9,16 +9,19 @@ class UpdateAccountService < BaseService
|
||||||
next unless ret
|
next unless ret
|
||||||
|
|
||||||
authorize_all_follow_requests(account) if was_locked && !account.locked
|
authorize_all_follow_requests(account) if was_locked && !account.locked
|
||||||
VerifyAccountLinksWorker.perform_async(@account.id) if account.fields_changed?
|
check_links(account)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def authorize_all_follow_requests(account)
|
def authorize_all_follow_requests(account)
|
||||||
follow_requests = FollowRequest.where(target_account: account)
|
AuthorizeFollowWorker.push_bulk(FollowRequest.where(target_account: account).select(:account_id, :target_account_id)) do |req|
|
||||||
AuthorizeFollowWorker.push_bulk(follow_requests) do |req|
|
|
||||||
[req.account_id, req.target_account_id]
|
[req.account_id, req.target_account_id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_links(account)
|
||||||
|
VerifyAccountLinksWorker.perform_async(account.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue