mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: When 410 is received, display proper error message instead of generic.
This commit is contained in:
@ -110,7 +110,7 @@ class ApplicationController < ActionController::Base
|
||||
if (request.format && request.format.json?) || (request.xhr?)
|
||||
# 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) ? build_not_found_page(status_code) : I18n.t(type)
|
||||
return render status: status_code, layout: false, text: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : I18n.t(type)
|
||||
end
|
||||
|
||||
render_json_error I18n.t(type), type: type, status: status_code
|
||||
|
Reference in New Issue
Block a user