fix the build

This commit is contained in:
Régis Hanol
2017-09-28 15:50:01 +02:00
parent 07e84a3afa
commit 8b74c7d325
2 changed files with 1 additions and 15 deletions

View File

@ -159,14 +159,7 @@ class ApplicationController < ActionController::Base
(request.xhr?) ||
((params[:external_id] || '').ends_with? '.json')
invalid_user =
begin
current_user
rescue Discourse::InvalidAccess
nil
end
if show_json_errors || invalid_user
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, plain: (status_code == 404 || status_code == 410) ? build_not_found_page(status_code) : I18n.t(type)