mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Prefer delegated nil-wrapping methods to safe navigation (#35541)
This commit is contained in:
parent
b464b87c2b
commit
5d69157e62
|
@ -30,9 +30,9 @@
|
|||
= t('admin.accounts.suspended')
|
||||
- elsif account.silenced?
|
||||
= t('admin.accounts.silenced')
|
||||
- elsif account.local? && account.user&.disabled?
|
||||
- elsif account.local? && account.user_disabled?
|
||||
= t('admin.accounts.disabled')
|
||||
- elsif account.local? && !account.user&.confirmed?
|
||||
- elsif account.local? && !account.user_confirmed?
|
||||
= t('admin.accounts.confirming')
|
||||
- elsif account.local? && !account.user_approved?
|
||||
= t('admin.accounts.pending')
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
%tr
|
||||
%th= t('admin.accounts.email_status')
|
||||
%td
|
||||
- if account.user&.confirmed?
|
||||
- if account.user_confirmed?
|
||||
= t('admin.accounts.confirmed')
|
||||
- else
|
||||
= t('admin.accounts.confirming')
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
%span.red= t('admin.accounts.suspended')
|
||||
- elsif target_account.silenced?
|
||||
%span.red= t('admin.accounts.silenced')
|
||||
- elsif target_account.user&.disabled?
|
||||
- elsif target_account.user_disabled?
|
||||
%span.red= t('admin.accounts.disabled')
|
||||
- else
|
||||
%span.neutral= t('admin.accounts.no_limits_imposed')
|
||||
|
|
|
@ -81,7 +81,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.presence || 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
|
||||
|
||||
|
@ -124,7 +124,7 @@ class MoveWorker
|
|||
|
||||
def add_account_note_if_needed!(account, id)
|
||||
unless AccountNote.exists?(account: account, target_account: @target_account)
|
||||
text = I18n.with_locale(account.user&.locale.presence || 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)
|
||||
|
|
|
@ -9,7 +9,7 @@ class PublishScheduledStatusWorker
|
|||
scheduled_status = ScheduledStatus.find(scheduled_status_id)
|
||||
scheduled_status.destroy!
|
||||
|
||||
return true if scheduled_status.account.user.disabled?
|
||||
return true if scheduled_status.account.user_disabled?
|
||||
|
||||
PostStatusService.new.call(
|
||||
scheduled_status.account,
|
||||
|
|
Loading…
Reference in New Issue
Block a user