FIX: staff/admin shouldn’t be able to create uncategorized topics (#7077)

This commit is contained in:
Joffrey JAFFEUX
2019-02-28 15:51:13 +01:00
committed by GitHub
parent 3517103398
commit 1cd64f68f1
3 changed files with 30 additions and 4 deletions

View File

@ -95,8 +95,7 @@ class Topic < ActiveRecord::Base
if: Proc.new { |t|
(t.new_record? || t.category_id_changed?) &&
!SiteSetting.allow_uncategorized_topics &&
(t.archetype.nil? || t.regular?) &&
(!t.user_id || !t.user.staff?)
(t.archetype.nil? || t.regular?)
}
validates :featured_link, allow_nil: true, url: true