mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:41:25 +08:00
FIX: Missing template error when rendering topics#show
error message.
This commit is contained in:
@ -162,7 +162,7 @@ class ApplicationController < ActionController::Base
|
||||
if show_json_errors
|
||||
# HACK: do not use render_json_error for topics#show
|
||||
if request.params[:controller] == 'topics' && request.params[:action] == 'show'
|
||||
return render status: status_code, layout: false, text: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : I18n.t(type)
|
||||
return render status: status_code, layout: false, plain: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : I18n.t(type)
|
||||
end
|
||||
|
||||
render_json_error I18n.t(opts[:custom_message] || type), type: type, status: status_code
|
||||
|
Reference in New Issue
Block a user