Bläddra i källkod

Add `openRegistrations` attribute to nodeinfo endpoint (#12058)

master^2
Eugen Rochko 4 år sedan
committed by GitHub
förälder
incheckning
4e1afef6f9
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 4AEE18F83AFDEB23
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. +5
    -1
      app/serializers/nodeinfo/serializer.rb

+ 5
- 1
app/serializers/nodeinfo/serializer.rb Visa fil

@@ -3,7 +3,7 @@
class NodeInfo::Serializer < ActiveModel::Serializer
include RoutingHelper

attributes :version, :software, :protocols, :usage
attributes :version, :software, :protocols, :usage, :open_registrations

def version
'2.0'
@@ -33,6 +33,10 @@ class NodeInfo::Serializer < ActiveModel::Serializer
}
end

def open_registrations
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
end

private

def instance_presenter


Laddar…
Avbryt
Spara