diff options
author | Florent MONTHEL <fmonthel@flox-arts.net> | 2017-02-21 00:06:11 -0500 |
---|---|---|
committer | Florent MONTHEL <fmonthel@flox-arts.net> | 2017-02-21 00:06:11 -0500 |
commit | a370e6aca38881f38c6d068bbcd6302401bb8ae7 (patch) | |
tree | bc0ff1adddb832d4196571aef2ce8e9f83806ec3 | |
parent | c8b7e148359a363d975149e9487e962233d7ee76 (diff) | |
download | wekan-a370e6aca38881f38c6d068bbcd6302401bb8ae7.tar.gz wekan-a370e6aca38881f38c6d068bbcd6302401bb8ae7.tar.bz2 wekan-a370e6aca38881f38c6d068bbcd6302401bb8ae7.zip |
[BUG] Bug when we're removing user from board that generate activity for all the card of the board
-rw-r--r-- | models/cards.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/models/cards.js b/models/cards.js index f6bd0b06..ab735ad0 100644 --- a/models/cards.js +++ b/models/cards.js @@ -340,13 +340,16 @@ if (Meteor.isServer) { // Say goodbye to the former member if (modifier.$pull && modifier.$pull.members) { memberId = modifier.$pull.members; - Activities.insert({ - userId, - memberId, - activityType: 'unjoinMember', - boardId: doc.boardId, - cardId: doc._id, - }); + // Check that the former member is member of the card + if (_.contains(doc.members, memberId)) { + Activities.insert({ + userId, + memberId, + activityType: 'unjoinMember', + boardId: doc.boardId, + cardId: doc._id, + }); + } } }); |