summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-11-06 23:36:43 +0200
committerLauri Ojansivu <x@xet7.org>2019-11-06 23:36:43 +0200
commit1728298659521ee8e6fc94fedad3160030b9a2c3 (patch)
tree8aa61f444f91b7b018cabcc6cd07949d43c058de /models
parent865c8305cbcd14d99b6ae6696a89a7261387c0e3 (diff)
downloadwekan-1728298659521ee8e6fc94fedad3160030b9a2c3.tar.gz
wekan-1728298659521ee8e6fc94fedad3160030b9a2c3.tar.bz2
wekan-1728298659521ee8e6fc94fedad3160030b9a2c3.zip
Assignee field like Jira #2452 , in progress.
Prevent more than one assignee. Thanks to xet7 !
Diffstat (limited to 'models')
-rw-r--r--models/cards.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/models/cards.js b/models/cards.js
index 633a3888..fd491372 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -1195,11 +1195,14 @@ Cards.mutations({
},
assignAssignee(assigneeId) {
- return {
- $addToSet: {
- assignees: assigneeId,
- },
- };
+ // If there is not any assignee, allow one assignee, not more.
+ if (this.getAssignees().length === 0) {
+ return {
+ $addToSet: {
+ assignees: assigneeId,
+ },
+ };
+ }
},
unassignMember(memberId) {