mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: check permalinks for deleted topics
- allow to specify 410 vs 404 in Discourse::NotFound exception - remove unused `permalink_redirect_or_not_found` which - handle JS side links to topics via Discourse-Xhr-Redirect mechanism
This commit is contained in:
@ -344,7 +344,7 @@ class ListController < ApplicationController
|
||||
parent_category_id = nil
|
||||
if parent_slug_or_id.present?
|
||||
parent_category_id = Category.query_parent_category(parent_slug_or_id)
|
||||
permalink_redirect_or_not_found && (return) if parent_category_id.blank? && !id
|
||||
raise Discourse::NotFound.new("category not found", check_permalinks: true) if parent_category_id.blank? && !id
|
||||
end
|
||||
|
||||
@category = Category.query_category(slug_or_id, parent_category_id)
|
||||
@ -355,7 +355,7 @@ class ListController < ApplicationController
|
||||
(redirect_to category.url, status: 301) && return if category
|
||||
end
|
||||
|
||||
permalink_redirect_or_not_found && (return) if !@category
|
||||
raise Discourse::NotFound.new("category not found", check_permalinks: true) if !@category
|
||||
|
||||
@description_meta = @category.description_text
|
||||
raise Discourse::NotFound unless guardian.can_see?(@category)
|
||||
|
Reference in New Issue
Block a user