Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
09f04d71
Unverified
Commit
09f04d71
authored
2 years ago
by
Eugen Rochko
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Change `closed_registrations_message` to `message` and add Markdown (#19486)
parent
371d9694
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/serializers/rest/instance_serializer.rb
+13
-1
app/serializers/rest/instance_serializer.rb
with
13 additions
and
1 deletion
+13
-1
app/serializers/rest/instance_serializer.rb
+
13
-
1
View file @
09f04d71
...
...
@@ -83,7 +83,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
{
enabled:
registrations_enabled?
,
approval_required:
Setting
.
registrations_mode
==
'approved'
,
closed_registrations_
message:
registrations_enabled?
?
nil
:
Setting
.
closed_
registrations_message
,
message:
registrations_enabled?
?
nil
:
registrations_message
,
}
end
...
...
@@ -92,4 +92,16 @@ class REST::InstanceSerializer < ActiveModel::Serializer
def
registrations_enabled?
Setting
.
registrations_mode
!=
'none'
&&
!
Rails
.
configuration
.
x
.
single_user_mode
end
def
registrations_message
if
Setting
.
closed_registrations_message
.
present?
markdown
.
render
(
Setting
.
closed_registrations_message
)
else
nil
end
end
def
markdown
@markdown
||=
Redcarpet
::
Markdown
.
new
(
Redcarpet
::
Render
::
HTML
,
no_images:
true
)
end
end
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets