diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-04-09 22:26:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 22:26:34 +0300 |
commit | c6afe8d00705d2b3aafb3924fbe963fffd6a404a (patch) | |
tree | 7288a3d6a3bc4b2c28518cd0e24ce74bf3be1da9 | |
parent | 93eccffd449384dd93035f78115f6344388cf023 (diff) | |
parent | 6ced47aa8c7c62764778f8123708455c0f33f82f (diff) | |
download | wekan-c6afe8d00705d2b3aafb3924fbe963fffd6a404a.tar.gz wekan-c6afe8d00705d2b3aafb3924fbe963fffd6a404a.tar.bz2 wekan-c6afe8d00705d2b3aafb3924fbe963fffd6a404a.zip |
Merge pull request #3004 from slvrpdr/master
When adding a user to a board that has subtasks, also add user to the subtask board
-rw-r--r-- | models/users.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/models/users.js b/models/users.js index 8a05a0d2..b1f3e26c 100644 --- a/models/users.js +++ b/models/users.js @@ -814,6 +814,16 @@ if (Meteor.isServer) { board.addMember(user._id); user.addInvite(boardId); + //Check if there is a subtasks board + if (board.subtasksDefaultBoardId){ + const subBoard = Boards.findOne(board.subtasksDefaultBoardId); + //If there is, also add user to that board + if (subBoard) { + subBoard.addMember(user._id); + user.addInvite(subBoard._id); + } + } + try { const params = { user: user.username, |