A platform for community discussion. Free, open, simple.
FIX: Use delete_all_posts_max to improve consistency when using the delete button from the admin view (#9194)
Roman Rizzic02273eb8bd0
diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js b/app/assets/javascripts/admin/controllers/admin-user-index.jsindex 0460c314c75..7bd7abe341b 100644--- a/app/assets/javascripts/admin/controllers/admin-user-index.js+++ b/app/assets/javascripts/admin/controllers/admin-user-index.js@@ -199,7 +199,8 @@ export default Controller.extend(CanCheckEmails, {destroy() {const postCount = this.get("model.post_count");- if (postCount <= 5) {+ const maxPostCount = this.siteSettings.delete_all_posts_max;+ if (postCount <= maxPostCount) {return this.model.destroy({ deletePosts: true });} else {return this.model.destroy();diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.jsindex a7d9ce8b294..421376609a3 100644--- a/app/assets/javascripts/discourse/models/user.js+++ b/app/assets/javascripts/discourse/models/user.js@@ -45,7 +45,8 @@ const User = RestModel.extend({@discourseComputed("can_be_deleted", "post_count")canBeDeleted(canBeDeleted, postCount) {- return canBeDeleted && postCount <= 5;+ const maxPostCount = Discourse.SiteSettings.delete_all_posts_max;+ return canBeDeleted && postCount <= maxPostCount;},@discourseComputed()