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

This commit is contained in:
Régis Hanol 2020-05-14 17:17:42 +02:00
parent 42b300b9be
commit ec8f08d0da

View File

@ -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