Skip to content

Commit

Permalink
DEV: remove sentiment setting
Browse files Browse the repository at this point in the history
  • Loading branch information
keegangeorge committed Mar 5, 2025
1 parent 3936b64 commit 9e82708
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ discourse_ai:
ai_sentiment_backfill_post_max_age_days:
default: 60
hidden: true
ai_sentiment_reports_enabled:
default: true
client: true

ai_openai_dall_e_3_url: "https://api.openai.com/v1/images/generations"
ai_openai_embeddings_url:
Expand Down
6 changes: 2 additions & 4 deletions lib/sentiment/entry_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ def inject_into(plugin)
plugin.on(:post_edited, &sentiment_analysis_cb)

plugin.add_to_serializer(:current_user, :can_see_sentiment_reports) do
ClassificationResult.has_sentiment_classification? && SiteSetting.ai_sentiment_enabled &&
SiteSetting.ai_sentiment_reports_enabled
ClassificationResult.has_sentiment_classification? && SiteSetting.ai_sentiment_enabled
end

if Rails.env.test? ||
ClassificationResult.has_sentiment_classification? &&
SiteSetting.ai_sentiment_enabled && SiteSetting.ai_sentiment_reports_enabled
ClassificationResult.has_sentiment_classification? && SiteSetting.ai_sentiment_enabled
EmotionFilterOrder.register!(plugin)
EmotionDashboardReport.register!(plugin)
SentimentDashboardReport.register!(plugin)
Expand Down
5 changes: 1 addition & 4 deletions spec/reports/sentiment_analysis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
fab!(:post_2) { Fabricate(:post, user: admin, topic: topic) }
fab!(:classification_result) { Fabricate(:classification_result, target: post) }

before do
SiteSetting.ai_sentiment_reports_enabled = true
SiteSetting.ai_sentiment_enabled = true
end
before { SiteSetting.ai_sentiment_enabled = true }

it "contains the correct filters" do
report = Report.find("sentiment_analysis")
Expand Down

0 comments on commit 9e82708

Please sign in to comment.