FIX: Skip poll tutorial if user cannot create polls (#9058)

This commit is contained in:
Dan Ungureanu
2020-02-27 16:01:59 +02:00
committed by GitHub
parent 0af2f5db64
commit d461772661
2 changed files with 21 additions and 4 deletions

View File

@ -82,7 +82,7 @@ module DiscourseNarrativeBot
},
tutorial_poll: {
prerequisite: Proc.new { SiteSetting.poll_enabled },
prerequisite: Proc.new { SiteSetting.poll_enabled && @user.has_trust_level?(SiteSetting.poll_minimum_trust_level_to_create) },
next_state: :tutorial_details,
next_instructions: Proc.new { I18n.t("#{I18N_KEY}.details.instructions", i18n_post_args) },
reply: {