summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-05-24 18:56:36 +0300
committerGitHub <noreply@github.com>2020-05-24 18:56:36 +0300
commit01346152b59255661c6c2e0fba149b4d41a801a1 (patch)
treefe507aa6abdff9101dbf52630e1ee0e3c803b630 /models
parent5b7b5b3e7ed4596c57d17f67a9c11d7a460877f6 (diff)
parent6e088af3d13b3b5912b783b485681bbd44ea4427 (diff)
downloadwekan-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.js6
-rw-r--r--models/settings.js2
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();