summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
+ });
+ }
}
});