FIX: Use delete_all_posts_max to improve consistency when using the delete button from the admin view (#9194)
This commit is contained in:
parent
ce50695bff
commit
c02273eb8b
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue