summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-02-22 00:58:43 +0200
committerLauri Ojansivu <x@xet7.org>2017-02-22 00:58:43 +0200
commit816d2bd01372987665c4d7cf2749f9b7b31a4bb9 (patch)
treebc0ff1adddb832d4196571aef2ce8e9f83806ec3
parentc8b7e148359a363d975149e9487e962233d7ee76 (diff)
parenta370e6aca38881f38c6d068bbcd6302401bb8ae7 (diff)
downloadwekan-816d2bd01372987665c4d7cf2749f9b7b31a4bb9.tar.gz
wekan-816d2bd01372987665c4d7cf2749f9b7b31a4bb9.tar.bz2
wekan-816d2bd01372987665c4d7cf2749f9b7b31a4bb9.zip
Merge branch 'fmonthel-devel' into devel
-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,
+ });
+ }
}
});