Skip to content

Commit

Permalink
Add registrations attribute to instance entity in REST API (mastodon#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and hiyuki2578 committed Oct 2, 2019
1 parent 563001e commit 98a3a9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/serializers/rest/instance_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer

attributes :uri, :title, :description, :email,
:version, :urls, :stats, :thumbnail,
:languages
:languages, :registrations

has_one :contact_account, serializer: REST::AccountSerializer

Expand Down Expand Up @@ -51,6 +51,10 @@ def languages
[I18n.default_locale]
end

def registrations
Setting.open_registrations && !Rails.configuration.x.single_user_mode
end

private

def instance_presenter
Expand Down

0 comments on commit 98a3a9f

Please sign in to comment.