diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-05-24 18:56:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 18:56:36 +0300 |
commit | 01346152b59255661c6c2e0fba149b4d41a801a1 (patch) | |
tree | fe507aa6abdff9101dbf52630e1ee0e3c803b630 /models | |
parent | 5b7b5b3e7ed4596c57d17f67a9c11d7a460877f6 (diff) | |
parent | 6e088af3d13b3b5912b783b485681bbd44ea4427 (diff) | |
download | wekan-01346152b59255661c6c2e0fba149b4d41a801a1.tar.gz wekan-01346152b59255661c6c2e0fba149b4d41a801a1.tar.bz2 wekan-01346152b59255661c6c2e0fba149b4d41a801a1.zip |
Merge pull request #3112 from marc1006/deepcode
Some fixes suggested by deepcode.ai
Diffstat (limited to 'models')
-rw-r--r-- | models/checklists.js | 6 | ||||
-rw-r--r-- | models/settings.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/models/checklists.js b/models/checklists.js index cf73e500..62c71d5f 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -100,13 +100,13 @@ Checklists.helpers({ }, checkAllItems() { const checkItems = ChecklistItems.find({ checklistId: this._id }); - checkItems.forEach(function(item) { + checkItems.forEach(item => { item.check(); }); }, uncheckAllItems() { const checkItems = ChecklistItems.find({ checklistId: this._id }); - checkItems.forEach(function(item) { + checkItems.forEach(item => { item.uncheck(); }); }, @@ -307,7 +307,7 @@ if (Meteor.isServer) { items = [items]; } } - items.forEach(function(item, idx) { + items.forEach((item, idx) => { ChecklistItems.insert({ cardId: paramCardId, checklistId: id, diff --git a/models/settings.js b/models/settings.js index fb823205..b665642e 100644 --- a/models/settings.js +++ b/models/settings.js @@ -259,7 +259,7 @@ if (Meteor.isServer) { throw new Meteor.Error('invalid-user'); } const user = Meteor.user(); - if (!user.emails && !user.emails[0] && user.emails[0].address) { + if (!user.emails || !user.emails[0] || user.emails[0].address) { throw new Meteor.Error('email-invalid'); } this.unblock(); |