Skip to content

Commit 0173f2c

Browse files
Gargronroot
authored andcommitted
Fix VerifyAccountLinksWorker not being queued (mastodon#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 mastodon#8703
1 parent 8887699 commit 0173f2c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/services/update_account_service.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ def call(account, params, raise_error: false)
99
next unless ret
1010

1111
authorize_all_follow_requests(account) if was_locked && !account.locked
12-
VerifyAccountLinksWorker.perform_async(@account.id) if account.fields_changed?
12+
check_links(account)
1313
end
1414
end
1515

1616
private
1717

1818
def authorize_all_follow_requests(account)
19-
follow_requests = FollowRequest.where(target_account: account)
20-
AuthorizeFollowWorker.push_bulk(follow_requests) do |req|
19+
AuthorizeFollowWorker.push_bulk(FollowRequest.where(target_account: account).select(:account_id, :target_account_id)) do |req|
2120
[req.account_id, req.target_account_id]
2221
end
2322
end
23+
24+
def check_links(account)
25+
VerifyAccountLinksWorker.perform_async(account.id)
26+
end
2427
end

0 commit comments

Comments
 (0)