mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
Add openRegistrations
attribute to nodeinfo endpoint (#12058)
This commit is contained in:
parent
575dc11cb2
commit
4e1afef6f9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user