mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 21:12:45 +08:00
FIX: don't error out when deleting a topic with no user
This commit is contained in:
parent
bf64280661
commit
ed4634dc34
|
@ -65,10 +65,12 @@ class StaffActionLogger
|
|||
def log_topic_deletion(deleted_topic, opts={})
|
||||
raise Discourse::InvalidParameters.new(:deleted_topic) unless deleted_topic && deleted_topic.is_a?(Topic)
|
||||
|
||||
user = delete_topic.user ? "#{deleted_topic.user.username} (#{deleted_topic.user.name})" : "(deleted user)"
|
||||
|
||||
details = [
|
||||
"id: #{deleted_topic.id}",
|
||||
"created_at: #{deleted_topic.created_at}",
|
||||
"user: #{deleted_topic.user.username} (#{deleted_topic.user.name})",
|
||||
"user: #{user}",
|
||||
"title: #{deleted_topic.title}"
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user