]> cat aescling's git repositories - mastodon.git/commitdiff
Prevent actions log from crashing when displaying deleted status (fixes #8133) (...
authorThibG <thib@sitedethib.com>
Thu, 16 Aug 2018 18:05:26 +0000 (20:05 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 16 Aug 2018 18:05:26 +0000 (20:05 +0200)
app/helpers/admin/action_logs_helper.rb
config/locales/en.yml

index 4c663211e718da0e12df68e4f0dfc0ce2cfd53ab..85bd303046e9e0342d803089f4d327cd889a3af5 100644 (file)
@@ -34,7 +34,11 @@ module Admin::ActionLogsHelper
       link_to attributes['domain'], "https://#{attributes['domain']}"
     when 'Status'
       tmp_status = Status.new(attributes)
-      link_to tmp_status.account&.acct || "##{tmp_status.account_id}", TagManager.instance.url_for(tmp_status)
+      if tmp_status.account
+        link_to tmp_status.account&.acct || "##{tmp_status.account_id}", admin_account_path(tmp_status.account_id)
+      else
+        I18n.t('admin.action_logs.deleted_status')
+      end
     end
   end
 
index 9c2800433e56b58b71ee0820572cda2f266234a7..cc24a02cfe72783e2c87e7e4eaa6293e07dc2caa 100644 (file)
@@ -184,6 +184,7 @@ en:
         unsuspend_account: "%{name} unsuspended %{target}'s account"
         update_custom_emoji: "%{name} updated emoji %{target}"
         update_status: "%{name} updated status by %{target}"
+      deleted_status: "(deleted status)"
       title: Audit log
     custom_emojis:
       by_domain: Domain