allow staff to delete user if posts are 5 or less irrespective of delete_user_max_post_age

This commit is contained in:
Arpit Jalan
2018-03-05 10:02:23 +05:30
parent ea812ea05d
commit 003b03d939
4 changed files with 29 additions and 5 deletions

View File

@ -67,9 +67,17 @@ export default Ember.Controller.extend(CanCheckEmails, {
silence() { return this.get("model").silence(); },
deleteAllPosts() { return this.get("model").deleteAllPosts(); },
anonymize() { return this.get('model').anonymize(); },
destroy() { return this.get('model').destroy(); },
disableSecondFactor() { return this.get('model').disableSecondFactor(); },
destroy() {
const postCount = this.get('model.post_count');
if (postCount <= 5) {
return this.get('model').destroy({ deletePosts: true });
} else {
return this.get('model').destroy();
}
},
viewActionLogs() {
this.get('adminTools').showActionLogs(this, {
target_user: this.get('model.username'),