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 Feb 16, 2019
1 parent 76dfb2f commit 492c3c4
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 492c3c4

Please sign in to comment.