Account deletion (#3728)

* Add form for account deletion

* If avatar or header are gone from source, remove them

* Add option to have SuspendAccountService remove user record, add tests

* Exclude suspended accounts from search
This commit is contained in:
Eugen Rochko
2017-06-14 18:01:27 +02:00
committed by GitHub
parent a208e7d655
commit 4a618908e8
15 changed files with 183 additions and 7 deletions

View File

@ -27,8 +27,19 @@ class UpdateRemoteProfileService < BaseService
account.locked = remote_profile.locked?
if !account.suspended? && !DomainBlock.find_by(domain: account.domain)&.reject_media?
account.avatar_remote_url = remote_profile.avatar if remote_profile.avatar.present?
account.header_remote_url = remote_profile.header if remote_profile.header.present?
if remote_profile.avatar.present?
account.avatar_remote_url = remote_profile.avatar
else
account.avatar_remote_url = ''
account.avatar.destroy
end
if remote_profile.header.present?
account.header_remote_url = remote_profile.header
else
account.header_remote_url = ''
account.header.destroy
end
end
end
end