mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 05:48:16 +08:00
FIX: Don't count draft views towards topic view stats (#28162)
When creating a shared draft, we're recording topic view stats on the draft and then pass those on when the draft is published, conflating the actual view count. This fixes that by not registering topic views if the topic is a shared draft.
This commit is contained in:
@ -1308,6 +1308,7 @@ class TopicsController < ApplicationController
|
||||
Scheduler::Defer.later "Topic View" do
|
||||
topic = Topic.find_by(id: topic_id)
|
||||
next if topic.blank?
|
||||
next if topic.shared_draft?
|
||||
|
||||
# We need to make sure that we aren't allowing recording
|
||||
# random topic views against topics the user cannot see.
|
||||
|
Reference in New Issue
Block a user