0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 11:00:28 +01:00
discourse-custom-wizard/lib/custom_wizard/extensions/topic_extension.rb

9 Zeilen
300 B
Ruby

DiscourseEvent.on(:before_create_topic) do |topic_params, user|
category = topic_params.category
if category&.custom_fields&.[]('create_topic_wizard').present?
raise Discourse::InvalidParameters.new(
I18n.t('wizard.error_messages.wizard_replacing_composer')
)
end
end