0
0
Fork 0

Change lists to be able to include accounts with pending follow requests (#19727)

This commit is contained in:
Claire 2023-05-02 14:40:36 +02:00 committed by GitHub
parent 598e63dad2
commit 6693a4fe7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 127 additions and 19 deletions

View file

@ -32,7 +32,8 @@ class FollowRequest < ApplicationRecord
validates :languages, language: true
def authorize!
account.follow!(target_account, reblogs: show_reblogs, notify: notify, languages: languages, uri: uri, bypass_limit: true)
follow = account.follow!(target_account, reblogs: show_reblogs, notify: notify, languages: languages, uri: uri, bypass_limit: true)
ListAccount.where(follow_request: self).update_all(follow_request_id: nil, follow_id: follow.id) # rubocop:disable Rails/SkipsModelValidations
MergeWorker.perform_async(target_account.id, account.id) if account.local?
destroy!
end