mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 13:38:49 +08:00
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() {
|
destroy() {
|
||||||
const postCount = this.get("model.post_count");
|
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 });
|
return this.model.destroy({ deletePosts: true });
|
||||||
} else {
|
} else {
|
||||||
return this.model.destroy();
|
return this.model.destroy();
|
||||||
|
|
|
@ -45,7 +45,8 @@ const User = RestModel.extend({
|
||||||
|
|
||||||
@discourseComputed("can_be_deleted", "post_count")
|
@discourseComputed("can_be_deleted", "post_count")
|
||||||
canBeDeleted(canBeDeleted, postCount) {
|
canBeDeleted(canBeDeleted, postCount) {
|
||||||
return canBeDeleted && postCount <= 5;
|
const maxPostCount = Discourse.SiteSettings.delete_all_posts_max;
|
||||||
|
return canBeDeleted && postCount <= maxPostCount;
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed()
|
@discourseComputed()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user