FIX: If a topic is deleted, allow the staff note to link to it anyway

This commit is contained in:
Robin Ward 2018-02-15 17:11:23 -05:00
parent 70b417272a
commit ed3e0a4157
1 changed files with 8 additions and 1 deletions

View File

@ -107,7 +107,14 @@ after_initialize do
end
def post_url
object[:post].try(:url)
url = object[:post].try(:url)
# In case the topic is deleted
if url == "/404"
url = "/t/#{object[:post].topic_id}/#{object[:post].post_number}"
end
url
end
def post_title