FIX: if badges are disabled badge pages should 404
This commit is contained in:
parent
adbc22530c
commit
ed750cac39
|
@ -2,6 +2,8 @@ class BadgesController < ApplicationController
|
||||||
skip_before_filter :check_xhr, only: [:index, :show]
|
skip_before_filter :check_xhr, only: [:index, :show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
raise Discourse::NotFound unless SiteSetting.enable_badges
|
||||||
|
|
||||||
badges = Badge.all
|
badges = Badge.all
|
||||||
|
|
||||||
if (params[:only_listable] == "true") || !request.xhr?
|
if (params[:only_listable] == "true") || !request.xhr?
|
||||||
|
@ -28,6 +30,8 @@ class BadgesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
raise Discourse::NotFound unless SiteSetting.enable_badges
|
||||||
|
|
||||||
params.require(:id)
|
params.require(:id)
|
||||||
badge = Badge.enabled.find(params[:id])
|
badge = Badge.enabled.find(params[:id])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue