Fixed when user unclaims a task assigned to them (#9578)

* Fixed when user unclaims a task assigned to them

* Removed test

* Fixed lint
This commit is contained in:
Keith Holliday
2017-11-27 11:38:59 -06:00
committed by GitHub
parent 0c7f9ca6bb
commit 1a5e820d88
2 changed files with 23 additions and 10 deletions

View File

@@ -243,7 +243,7 @@ api.unassignTask = {
let group = await Group.getGroup({user, groupId: task.group.id, fields});
if (!group) throw new NotFound(res.t('groupNotFound'));
if (canNotEditTasks(group, user)) throw new NotAuthorized(res.t('onlyGroupLeaderCanEditTasks'));
if (canNotEditTasks(group, user, assignedUserId)) throw new NotAuthorized(res.t('onlyGroupLeaderCanEditTasks'));
await group.unlinkTask(task, assignedUser);