Fix avatar and header descriptions being returned for suspended accounts (#37641)
This commit is contained in:
parent
f861a5cee0
commit
a495a0cbfc
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user