FIX: Skip gists from PM topic lists (#923)

This commit is contained in:
Roman Rizzi 2024-11-19 12:51:19 -03:00 committed by GitHub
parent fb80d776d8
commit 3c91f374ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ module DiscourseAi
end end
plugin.register_modifier(:topic_query_create_list_topics) do |topics, options| plugin.register_modifier(:topic_query_create_list_topics) do |topics, options|
skipped_filters = %i[suggested semantic_related] skipped_filters = %i[suggested semantic_related private_messages]
if !skipped_filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled && if !skipped_filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled &&
SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0 SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0
@ -36,7 +36,7 @@ module DiscourseAi
:ai_topic_gist, :ai_topic_gist,
include_condition: -> { scope.can_see_gists? }, include_condition: -> { scope.can_see_gists? },
) do ) do
return if %i[suggested semantic_related].include?(options[:filter]) return if %i[suggested semantic_related private_messages].include?(options[:filter])
summaries = object.ai_summaries.to_a summaries = object.ai_summaries.to_a
# Summaries should always have one or zero elements here. # Summaries should always have one or zero elements here.