URGENT: blank string in auto close time was causing stuff to blow up - non mods could not create topics

This commit is contained in:
Sam 2013-11-28 12:41:04 +11:00
parent 0e9c34ff12
commit e1db744d6a

View file

@ -16,7 +16,7 @@ class TopicCreator
topic_params = setup topic_params = setup
@topic = Topic.new(topic_params) @topic = Topic.new(topic_params)
setup_auto_close_time if @opts[:auto_close_time] setup_auto_close_time if @opts[:auto_close_time].present?
process_private_message if @opts[:archetype] == Archetype.private_message process_private_message if @opts[:archetype] == Archetype.private_message
save_topic save_topic
@ -47,7 +47,6 @@ class TopicCreator
else else
Category.where(name: @opts[:category]).first Category.where(name: @opts[:category]).first
end end
@guardian.ensure_can_create!(Topic,category) @guardian.ensure_can_create!(Topic,category)
topic_params[:category_id] = category.id if category.present? topic_params[:category_id] = category.id if category.present?
topic_params[:meta_data] = @opts[:meta_data] if @opts[:meta_data].present? topic_params[:meta_data] = @opts[:meta_data] if @opts[:meta_data].present?