Fix AdminUser bulkApprove; add a way to approve a user without sending them the welcome email for cases when must_approve_users is enabled and there are existing users
This commit is contained in:
parent
03afe9280d
commit
b1d0f30379
|
@ -223,7 +223,6 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
if (model.get('loadedDetails')) { return; }
|
||||
|
||||
Discourse.AdminUser.find(model.get('username_lower')).then(function (result) {
|
||||
console.log("loaded details");
|
||||
model.setProperties(result);
|
||||
model.set('loadedDetails', true);
|
||||
});
|
||||
|
@ -234,7 +233,7 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
Discourse.AdminUser.reopenClass({
|
||||
|
||||
bulkApprove: function(users) {
|
||||
users.each(function(user) {
|
||||
_.each(users, function(user) {
|
||||
user.set('approved', true);
|
||||
user.set('can_approve', false);
|
||||
return user.set('selected', false);
|
||||
|
|
|
@ -194,12 +194,12 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# Approve this user
|
||||
def approve(approved_by)
|
||||
def approve(approved_by, send_mail=true)
|
||||
self.approved = true
|
||||
self.approved_by = approved_by
|
||||
self.approved_at = Time.now
|
||||
|
||||
send_approval_email if save
|
||||
send_approval_email if save and send_mail
|
||||
end
|
||||
|
||||
def self.email_hash(email)
|
||||
|
|
Loading…
Reference in New Issue