mirror of
https://github.com/mastodon/mastodon.git
synced 2026-09-12 23:16:14 -05:00
Fix avatar and header descriptions being returned for suspended accounts (#37641)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user