Fix avatar and header descriptions being returned for suspended accounts (#37641)

This commit is contained in:
Claire 2026-01-28 12:06:30 +01:00 committed by GitHub
parent f861a5cee0
commit a495a0cbfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,6 +82,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
full_asset_url(object.unavailable? ? object.avatar.default_url : object.avatar_static_url)
end
def avatar_description
object.unavailable? ? '' : object.avatar_description
end
def header
full_asset_url(object.unavailable? ? object.header.default_url : object.header_original_url)
end
@ -90,6 +94,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
full_asset_url(object.unavailable? ? object.header.default_url : object.header_static_url)
end
def header_description
object.unavailable? ? '' : object.header_description
end
def created_at
object.created_at.midnight.as_json
end