mirror of
https://github.com/discourse/discourse.git
synced 2026-08-26 21:27:16 -05:00
FIX: Show a nicer error when a user tries to access a category they
can't see.
This commit is contained in:
@@ -217,6 +217,7 @@ class ListController < ApplicationController
|
||||
|
||||
@category = Category.where(slug: slug_or_id, parent_category_id: parent_category_id).includes(:featured_users).first ||
|
||||
Category.where(id: slug_or_id.to_i, parent_category_id: parent_category_id).includes(:featured_users).first
|
||||
guardian.ensure_can_see!(@category)
|
||||
|
||||
raise Discourse::NotFound.new if @category.blank?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user