mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: per-category approval settings (#5778)
- disallow moving topics to a category that requires topic approval
This commit is contained in:
@@ -259,7 +259,7 @@ class TopicsController < ApplicationController
|
||||
if params[:category_id] && (params[:category_id].to_i != topic.category_id.to_i)
|
||||
category = Category.find_by(id: params[:category_id])
|
||||
if category || (params[:category_id].to_i == 0)
|
||||
guardian.ensure_can_create_topic_on_category!(category)
|
||||
guardian.ensure_can_move_topic_to_category!(category)
|
||||
else
|
||||
return render_json_error(I18n.t('category.errors.not_found'))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user