about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/initial_state_serializer.rb1
-rw-r--r--app/serializers/rest/account_serializer.rb4
-rw-r--r--app/serializers/rest/instance_serializer.rb3
3 files changed, 4 insertions, 4 deletions
diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb
index c45de4e06..8243a103f 100644
--- a/app/serializers/initial_state_serializer.rb
+++ b/app/serializers/initial_state_serializer.rb
@@ -47,6 +47,7 @@ class InitialStateSerializer < ActiveModel::Serializer
       single_user_mode: Rails.configuration.x.single_user_mode,
       translation_enabled: TranslationService.configured?,
       trends_as_landing_page: Setting.trends_as_landing_page,
+      status_page_url: Setting.status_page_url,
     }
 
     if object.current_account
diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb
index c4e281b80..b95a61e89 100644
--- a/app/serializers/rest/account_serializer.rb
+++ b/app/serializers/rest/account_serializer.rb
@@ -129,10 +129,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
   end
 
   def roles
-    if object.suspended?
+    if object.suspended? || object.user.nil?
       []
     else
-      [object.user.role].compact.filter { |role| role.highlighted? }
+      [object.user.role].compact.filter(&:highlighted?)
     end
   end
 
diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb
index 24a1c1ae6..c97db9c5f 100644
--- a/app/serializers/rest/instance_serializer.rb
+++ b/app/serializers/rest/instance_serializer.rb
@@ -45,6 +45,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
     {
       urls: {
         streaming: Rails.configuration.x.streaming_api_base_url,
+        status: object.status_page_url,
       },
 
       accounts: {
@@ -97,8 +98,6 @@ class REST::InstanceSerializer < ActiveModel::Serializer
   def registrations_message
     if Setting.closed_registrations_message.present?
       markdown.render(Setting.closed_registrations_message)
-    else
-      nil
     end
   end