Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 02:50:28 +01:00
10 Zeilen
331 B
Ruby
10 Zeilen
331 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|