Fix juror drop: remove from jury group + reassign projects
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m7s
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m7s
The reassignDroppedJuror flow was missing a key step — after reshuffling unsubmitted projects to other jurors, the dropped juror was not removed from the jury group. This meant they could be re-assigned in future assignment runs. Now deletes the JuryGroupMember record after reshuffle, logs removal in audit, and updates the confirmation dialog to reflect the full action. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -433,6 +433,19 @@ async function reassignDroppedJurorAssignments(params: {
|
||||
})
|
||||
}
|
||||
|
||||
// Remove the dropped juror from the jury group so they can't be re-assigned
|
||||
// in future assignment runs for this round's competition.
|
||||
let removedFromGroup = false
|
||||
if (round.juryGroupId) {
|
||||
const deleted = await prisma.juryGroupMember.deleteMany({
|
||||
where: {
|
||||
juryGroupId: round.juryGroupId,
|
||||
userId: params.droppedJurorId,
|
||||
},
|
||||
})
|
||||
removedFromGroup = deleted.count > 0
|
||||
}
|
||||
|
||||
if (params.auditUserId) {
|
||||
await logAudit({
|
||||
prisma,
|
||||
@@ -448,6 +461,7 @@ async function reassignDroppedJurorAssignments(params: {
|
||||
failedProjects,
|
||||
skippedProjects,
|
||||
reassignedTo,
|
||||
removedFromGroup,
|
||||
},
|
||||
ipAddress: params.auditIp,
|
||||
userAgent: params.auditUserAgent,
|
||||
|
||||
Reference in New Issue
Block a user