mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
Add registrations attribute to instance entity in REST API (#10060)
Fix #9350
This commit is contained in:
parent
80388a3ffe
commit
a006d4afbe
@ -5,7 +5,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||||||
|
|
||||||
attributes :uri, :title, :description, :email,
|
attributes :uri, :title, :description, :email,
|
||||||
:version, :urls, :stats, :thumbnail,
|
:version, :urls, :stats, :thumbnail,
|
||||||
:languages
|
:languages, :registrations
|
||||||
|
|
||||||
has_one :contact_account, serializer: REST::AccountSerializer
|
has_one :contact_account, serializer: REST::AccountSerializer
|
||||||
|
|
||||||
@ -51,6 +51,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
|||||||
[I18n.default_locale]
|
[I18n.default_locale]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def registrations
|
||||||
|
Setting.open_registrations && !Rails.configuration.x.single_user_mode
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def instance_presenter
|
def instance_presenter
|
||||||
|
Loading…
Reference in New Issue
Block a user