Browse Source

Add registrations attribute to instance entity in REST API (#10060)

Fix #9350
pull/4/head
Eugen Rochko 5 years ago
committed by GitHub
parent
commit
a006d4afbe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/serializers/rest/instance_serializer.rb

+ 5
- 1
app/serializers/rest/instance_serializer.rb View File

@ -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
@ -51,6 +51,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
[I18n.default_locale]
end
def registrations
Setting.open_registrations && !Rails.configuration.x.single_user_mode
end
private
def instance_presenter

Loading…
Cancel
Save