From ec8f08d0da1b32213f3674d8e6dd8ff98e84d39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 14 May 2020 17:17:42 +0200 Subject: [PATCH] =?UTF-8?q?FIX:=20don't=20compute=20draft=20for=20(ro)bots?= =?UTF-8?q?=20=F0=9F=A4=96=20in=20topics=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/topic_list_responder.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/topic_list_responder.rb b/lib/topic_list_responder.rb index c590e250ff2..545b8ece1de 100644 --- a/lib/topic_list_responder.rb +++ b/lib/topic_list_responder.rb @@ -7,8 +7,11 @@ module TopicListResponder discourse_expires_in 1.minute list.draft_key = Draft::NEW_TOPIC - list.draft_sequence = DraftSequence.current(current_user, Draft::NEW_TOPIC) - list.draft = Draft.get(current_user, list.draft_key, list.draft_sequence) if current_user + + if current_user&.human? + list.draft_sequence = DraftSequence.current(current_user, list.draft_key) + list.draft = Draft.get(current_user, list.draft_key, list.draft_sequence) + end respond_to do |format| format.html do