mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 14:50:09 +08:00
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…
x
Reference in New Issue
Block a user