mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:57:25 +08:00
FEATURE: Ability to clear a user's penalty history
You can do this manually if you want to allow them to reach TL3 without their penalty history counting against them.
This commit is contained in:
@ -103,6 +103,16 @@ export default Ember.Controller.extend(CanCheckEmails, {
|
||||
anonymize() { return this.get('model').anonymize(); },
|
||||
disableSecondFactor() { return this.get('model').disableSecondFactor(); },
|
||||
|
||||
|
||||
clearPenaltyHistory() {
|
||||
let user = this.get('model');
|
||||
return ajax(`/admin/users/${user.get('id')}/penalty_history`, {
|
||||
type: 'DELETE'
|
||||
}).then(() => {
|
||||
user.set('tl3_requirements.penalty_counts.total', 0);
|
||||
}).catch(popupAjaxError);
|
||||
},
|
||||
|
||||
destroy() {
|
||||
const postCount = this.get('model.post_count');
|
||||
if (postCount <= 5) {
|
||||
|
Reference in New Issue
Block a user