summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorFlorent MONTHEL <fmonthel@flox-arts.net>2017-02-21 00:06:11 -0500
committerFlorent MONTHEL <fmonthel@flox-arts.net>2017-02-21 00:06:11 -0500
commita370e6aca38881f38c6d068bbcd6302401bb8ae7 (patch)
treebc0ff1adddb832d4196571aef2ce8e9f83806ec3 /models/cards.js
parentc8b7e148359a363d975149e9487e962233d7ee76 (diff)
downloadwekan-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
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js17
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,
+ });
+ }
}
});