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

Continue of https://github.com/discourse/discourse/pull/19766

When TL4 is allowed to delete topic, they should not be redirected to / after that action.
This commit is contained in:
Krzysztof Kotlarek 2023-01-24 11:28:04 +11:00 committed by GitHub
parent 110c96e6d7
commit ac4ee1a3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -471,6 +471,10 @@ const Topic = RestModel.extend({
!deleted_by.staff && !deleted_by.staff &&
!deleted_by.groups.some( !deleted_by.groups.some(
(group) => group.name === this.category.reviewable_by_group_name (group) => group.name === this.category.reviewable_by_group_name
) &&
!(
this.siteSettings.tl4_delete_posts_and_topics &&
deleted_by.trust_level >= 4
) )
) { ) {
DiscourseURL.redirectTo("/"); DiscourseURL.redirectTo("/");