about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-03 10:26:09 +0200
committerGitHub <noreply@github.com>2022-06-03 10:26:09 +0200
commitd2f5760ceb12ade0134be5a5fe96e677c5e6c925 (patch)
tree64164086531e2fc9a4a4abb355add786ba79f3af /app/workers
parentc1d0a6a7981b5fe74bdd03c958a558096ea3cde8 (diff)
parent7bf37551c8ee55d05a5dbca23db2cae7bb572789 (diff)
Merge pull request #1793 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/move_worker.rb4
-rw-r--r--app/workers/web/push_notification_worker.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/workers/move_worker.rb b/app/workers/move_worker.rb
index 4a900e3b8..c3167f9ca 100644
--- a/app/workers/move_worker.rb
+++ b/app/workers/move_worker.rb
@@ -47,7 +47,7 @@ class MoveWorker
 
   def copy_account_notes!
     AccountNote.where(target_account: @source_account).find_each do |note|
-      text = I18n.with_locale(note.account.user&.locale || I18n.default_locale) do
+      text = I18n.with_locale(note.account.user&.locale.presence || I18n.default_locale) do
         I18n.t('move_handler.copy_account_note_text', acct: @source_account.acct)
       end
 
@@ -90,7 +90,7 @@ class MoveWorker
 
   def add_account_note_if_needed!(account, id)
     unless AccountNote.where(account: account, target_account: @target_account).exists?
-      text = I18n.with_locale(account.user&.locale || I18n.default_locale) do
+      text = I18n.with_locale(account.user&.locale.presence || I18n.default_locale) do
         I18n.t(id, acct: @source_account.acct)
       end
       AccountNote.create!(account: account, target_account: @target_account, comment: text)
diff --git a/app/workers/web/push_notification_worker.rb b/app/workers/web/push_notification_worker.rb
index 57f5b5c22..1ed5bb9e0 100644
--- a/app/workers/web/push_notification_worker.rb
+++ b/app/workers/web/push_notification_worker.rb
@@ -51,7 +51,7 @@ class Web::PushNotificationWorker
   private
 
   def push_notification_json
-    json = I18n.with_locale(@subscription.locale || I18n.default_locale) do
+    json = I18n.with_locale(@subscription.locale.presence || I18n.default_locale) do
       ActiveModelSerializers::SerializableResource.new(
         @notification,
         serializer: Web::NotificationSerializer,