FIX: don't try to create category description topic if it already exists
This commit is contained in:
parent
a07062644c
commit
99285f73e7
|
@ -11,6 +11,7 @@ unless Rails.env.test?
|
|||
raise "Failed to set permissions on trust level 3 lounge category!"
|
||||
end
|
||||
|
||||
if lounge.topic_id.nil?
|
||||
creator = PostCreator.new(Discourse.system_user,
|
||||
raw: I18n.t('vip_category_description'),
|
||||
title: I18n.t('category.topic_prefix', category: lounge.name),
|
||||
|
@ -35,3 +36,4 @@ unless Rails.env.test?
|
|||
Category.exec_sql "UPDATE categories SET topic_count = 0 WHERE id = #{lounge.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,6 +10,7 @@ unless Rails.env.test?
|
|||
raise "Failed to set permissions on the Staff category!"
|
||||
end
|
||||
|
||||
if staff.topic_id.nil?
|
||||
creator = PostCreator.new(Discourse.system_user,
|
||||
raw: I18n.t('staff_category_description'),
|
||||
title: I18n.t('category.topic_prefix', category: staff.name),
|
||||
|
@ -34,3 +35,4 @@ unless Rails.env.test?
|
|||
Category.exec_sql "UPDATE categories SET topic_count = 0 WHERE id = #{staff.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue