mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 09:35:03 +00:00
Add short_description
and approval_required
to GET /api/v1/instance
(#11146)
This commit is contained in:
parent
aa9b37822b
commit
d61d164685
|
@ -3,9 +3,9 @@
|
||||||
class REST::InstanceSerializer < ActiveModel::Serializer
|
class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
include RoutingHelper
|
include RoutingHelper
|
||||||
|
|
||||||
attributes :uri, :title, :description, :email,
|
attributes :uri, :title, :short_description, :description, :email,
|
||||||
:version, :urls, :stats, :thumbnail,
|
:version, :urls, :stats, :thumbnail,
|
||||||
:languages, :registrations
|
:languages, :registrations, :approval_required
|
||||||
|
|
||||||
has_one :contact_account, serializer: REST::AccountSerializer
|
has_one :contact_account, serializer: REST::AccountSerializer
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
Setting.site_title
|
Setting.site_title
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def short_description
|
||||||
|
Setting.site_short_description
|
||||||
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
Setting.site_description
|
Setting.site_description
|
||||||
end
|
end
|
||||||
|
@ -55,6 +59,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
|
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def approval_required
|
||||||
|
Setting.registrations_mode == 'approved'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def instance_presenter
|
def instance_presenter
|
||||||
|
|
Loading…
Reference in a new issue