From 76561f044c75d06ba285bf688c2a6b874974fc8e Mon Sep 17 00:00:00 2001
From: Taico Aerts <t.v.aerts@tudelft.nl>
Date: Thu, 22 Sep 2022 11:31:54 +0200
Subject: [PATCH] Also hide locked posts

---
 app/controllers/application_controller.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8b3211ce7..ce8c81040 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -269,6 +269,7 @@ class ApplicationController < ActionController::Base
     @hot_questions = Rails.cache.fetch('hot_questions', expires_in: 4.hours) do
       Rack::MiniProfiler.step 'hot_questions: cache miss' do
         Post.undeleted.where(closed: false)
+            .where(locked: false)
             .where(last_activity: (Rails.env.development? ? 365 : 7).days.ago..DateTime.now)
             .where(post_type_id: [Question.post_type_id, Article.post_type_id])
             .joins(:category).where(categories: { use_for_hot_posts: true })
-- 
GitLab