Преглед изворни кода

Fix: send email even if failed to create user

Sotaro KARASAWA пре 11 година
родитељ
комит
5906d0a7e0
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      models/user.js

+ 5 - 0
models/user.js

@@ -334,6 +334,7 @@ module.exports = function(app, models) {
         // email check
         // TODO: 削除済みはチェック対象から外そう〜
         User.findOne({email: email}, function (err, userData) {
+          // The user is exists
           if (userData) {
             createdUserList.push({
               email: email,
@@ -382,6 +383,10 @@ module.exports = function(app, models) {
           async.each(
             createdUserList,
             function(user, next) {
+              if (user.password === null) {
+                next();
+              }
+
               mailer.send({
                   to: user.email,
                   subject: 'Invitation to ' + config.crowi['app:title'],