Skip to content

Commit

Permalink
Ensure topic object is an instance of Topic in qa_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Jun 20, 2018
1 parent badb7fa commit 89fee2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/qa_helper.rb
Expand Up @@ -2,8 +2,8 @@ module QAHelper
class << self
def qa_enabled(topic)
return false if !SiteSetting.qa_enabled
return false if topic.is_category_topic?
return false if !topic || !topic.respond_to?(:is_category_topic?) || topic.is_category_topic?

tags = topic.tags.map(&:name)
has_qa_tag = !(tags & SiteSetting.qa_tags.split('|')).empty?
is_qa_category = topic.category && topic.category.custom_fields["qa_enabled"]
Expand Down

0 comments on commit 89fee2f

Please sign in to comment.