FIX: don't compute draft for (ro)bots 🤖 in topics list

FIX: don’t compute draft for (ro)bots :robot: in topics list

diff --git a/lib/topic_list_responder.rb b/lib/topic_list_responder.rb
index c590e25..545b8ec 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

GitHub sha: ec8f08d0

Resolved in FIX: Always return 0 for non-human user current DraftSequence. · discourse/discourse@165fa13 · GitHub

1 Like