Skip to content

A platform for community discussion. Free, open, simple.

FIX: TL4 user is not redirected to latest when delete topic (#19967)

Krzysztof Kotlarekac4ee1a3d47c
diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.js
index f4729483375..4667825058c 100644
--- a/app/assets/javascripts/discourse/app/models/topic.js
+++ b/app/assets/javascripts/discourse/app/models/topic.js
@@ -471,6 +471,10 @@ const Topic = RestModel.extend({
!deleted_by.staff &&
!deleted_by.groups.some(
(group) => group.name === this.category.reviewable_by_group_name
+ ) &&
+ !(
+ this.siteSettings.tl4_delete_posts_and_topics &&
+ deleted_by.trust_level >= 4
)
) {
DiscourseURL.redirectTo("/");