Skip to content

Commit

Permalink
Add registrations attribute to instance entity in REST API (#10060)
Browse files Browse the repository at this point in the history
Fix #9350
  • Loading branch information
Gargron committed Feb 16, 2019
1 parent 80388a3 commit a006d4a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/serializers/rest/instance_serializer.rb
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 a006d4a

Please sign in to comment.