summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--models/cards.js17
2 files changed, 13 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7671426e..901abdd1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,9 @@ This release adds following new features:
and fixes the following bugs:
* Dockerfile was missing EXPOSE $PORT;
+* Bug when removing user from board that generate activity for
+ all cards of the board. Add check before user is one owner
+ of the card before adding activity.
* Typos.
Thanks to GitHub users fmonthel, jLouzado, vuxor, whittssg2
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,
+ });
+ }
}
});