mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
DEV: Return the right response code and error message.
Follow up to d1dbafebbc4b21c2a6714cd19c0ba05fac7717c4. Also remove test that is a duplicate of 867c1a5ac9355aadef35d60fd9c7aa4ebd0eda25.
This commit is contained in:
@ -121,7 +121,9 @@ class TopicCreator
|
||||
category = find_category
|
||||
@guardian.ensure_can_create!(Topic, category) unless (@opts[:skip_validations] || @opts[:archetype] == Archetype.private_message)
|
||||
|
||||
raise Discourse::NotFound if @opts[:category].present? && category.nil?
|
||||
if @opts[:category].present? && category.nil?
|
||||
raise Discourse::InvalidParameters.new(:category)
|
||||
end
|
||||
|
||||
topic_params[:category_id] = category.id if category.present?
|
||||
|
||||
|
Reference in New Issue
Block a user