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:
Neil Lalonde 2013-06-26 13:24:30 -04:00
parent 03afe9280d
commit b1d0f30379
2 changed files with 3 additions and 4 deletions

View File

@ -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);

View File

@ -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)