Browse Source

Add `invites_enabled` to API (#13501)

master^2
ThibG GitHub 11 months ago
parent
commit
b40d68cc31
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, :short_description, :description, :email,
:version, :urls, :stats, :thumbnail,
:languages, :registrations, :approval_required
:languages, :registrations, :approval_required, :invites_enabled

has_one :contact_account, serializer: REST::AccountSerializer

@@ -63,6 +63,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
Setting.registrations_mode == 'approved'
end

def invites_enabled
Setting.min_invite_role == 'user'
end

private

def instance_presenter


Loading…
Cancel
Save