From 75c8486b1a3f7bcc06e9d525865648afc8d50176 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Tue, 23 Aug 2022 14:38:05 -0500 Subject: [PATCH] fix(checklists): allow scoring own items --- website/server/controllers/api-v3/tasks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/server/controllers/api-v3/tasks.js b/website/server/controllers/api-v3/tasks.js index a386420ad6..c937f5efb0 100644 --- a/website/server/controllers/api-v3/tasks.js +++ b/website/server/controllers/api-v3/tasks.js @@ -961,7 +961,8 @@ api.scoreCheckListItem = { if (!task || (!task.userId && !task.group.id)) throw new NotFound(res.t('messageTaskNotFound')); if (task.userId && task.userId !== user._id) { throw new BadRequest('Cannot score task belonging to another user.'); - } else if (user.guilds.indexOf(task.group.id) === -1 && user.party._id !== task.group.id) { + } else if (task.group.id && user.guilds.indexOf(task.group.id) === -1 + && user.party._id !== task.group.id) { throw new BadRequest('Cannot score task belonging to another user.'); } if (task.type !== 'daily' && task.type !== 'todo') throw new BadRequest(res.t('checklistOnlyDailyTodo'));