FIX: Bulk deleting topics should ignore already deleted topics

This commit is contained in:
Gerhard Schlager 2018-08-14 16:15:46 +02:00
parent c358421ca5
commit 2927294cc6

View File

@ -136,7 +136,8 @@ class TopicsBulkAction
def delete
topics.each do |t|
if guardian.can_delete?(t)
PostDestroyer.new(@user, t.ordered_posts.first).destroy
post = t.ordered_posts.first
PostDestroyer.new(@user, post).destroy if post
end
end
end
@ -166,7 +167,7 @@ class TopicsBulkAction
if tags.present?
DiscourseTagging.tag_topic_by_names(t, guardian, tags, append: true)
end
@changed_ids << t.id
@changed_ids << t.id
end
end
end