mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix delete user button on admin/user page so it's enabled at the right times, and update its title attribute to be more helpful
This commit is contained in:
@@ -202,12 +202,12 @@ Discourse.AdminUser = Discourse.User.extend({
|
||||
},
|
||||
|
||||
deleteForbidden: function() {
|
||||
return (this.get('post_count') > 0);
|
||||
return (!this.get('can_be_deleted') || this.get('post_count') > 0);
|
||||
}.property('post_count'),
|
||||
|
||||
deleteButtonTitle: function() {
|
||||
if (this.get('deleteForbidden')) {
|
||||
return I18n.t('admin.user.delete_forbidden');
|
||||
return I18n.t('admin.user.delete_forbidden', {count: Discourse.SiteSettings.delete_user_max_age});
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user