diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/cards.js | 10 | ||||
-rw-r--r-- | models/users.js | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/models/cards.js b/models/cards.js index 9c149e51..922fbecd 100644 --- a/models/cards.js +++ b/models/cards.js @@ -354,9 +354,19 @@ if (Meteor.isServer) { }); // Remove all activities associated with a card if we remove the card + // Remove also card_comments / checklists / attachments Cards.after.remove((userId, doc) => { Activities.remove({ cardId: doc._id, }); + Checklists.remove({ + cardId: doc._id, + }); + CardComments.remove({ + cardId: doc._id, + }); + Attachments.remove({ + cardId: doc._id, + }); }); } diff --git a/models/users.js b/models/users.js index b77c7a84..06b84fa0 100644 --- a/models/users.js +++ b/models/users.js @@ -349,7 +349,8 @@ if (Meteor.isServer) { } else { if (posAt <= 0) throw new Meteor.Error('error-user-doesNotExist'); if (Settings.findOne().disableRegistration) throw new Meteor.Error('error-user-notCreated'); - const email = username; + // Set in lowercase email before creating account + const email = username.toLowerCase(); username = email.substring(0, posAt); const newUserId = Accounts.createUser({ username, email }); if (!newUserId) throw new Meteor.Error('error-user-notCreated'); @@ -377,7 +378,7 @@ if (Meteor.isServer) { }; const lang = user.getLanguage(); Email.send({ - to: user.emails[0].address, + to: user.emails[0].address.toLowerCase(), from: Accounts.emailTemplates.from, subject: TAPi18n.__('email-invite-subject', params, lang), text: TAPi18n.__('email-invite-text', params, lang), |