mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Revert "Merge pull request #1215 from Elegios/composer_use_category_id"
This reverts commit 763859d4396f406352c4901502a8c33430e54cb2, reversing changes made to b62caf80fbb81ea7a8ece5632513fcc8559db0e1.
This commit is contained in:
@ -39,14 +39,7 @@ class TopicCreator
|
||||
topic_params[:archetype] = @opts[:archetype] if @opts[:archetype].present?
|
||||
topic_params[:subtype] = @opts[:subtype] if @opts[:subtype].present?
|
||||
|
||||
# Temporary fix to allow older clients to create topics.
|
||||
# When all clients are updated the category variable should
|
||||
# be set directly to the contents of the if statement.
|
||||
category = if @opts[:category].is_a? Integer || @opts[:category] =~ /^\d+$/
|
||||
Category.where(id: @opts[:category]).first
|
||||
else
|
||||
Category.where(name: @opts[:category]).first
|
||||
end
|
||||
category = Category.where(name: @opts[:category]).first
|
||||
|
||||
@guardian.ensure_can_create!(Topic,category)
|
||||
topic_params[:category_id] = category.id if category.present?
|
||||
|
Reference in New Issue
Block a user