Skip to content

Commit 9e8a8bd

Browse files
authored
fix: allow users with cursus end date in future to take quiz
1 parent fda8d1d commit 9e8a8bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/quiz.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const isQuizAvailable = async function(user: IntraUser | ExpressIntraUser
105105
return false;
106106
}
107107
if (userDetails.coalition_users.length === 0 || availableDueToTime) {
108-
if (userDetails.cursus_users.length > 0 && !userDetails.cursus_users[0].end_at) {
108+
if (userDetails.cursus_users.length > 0 && (!userDetails.cursus_users[0].end_at || userDetails.cursus_users[0].end_at > currentDate)) {
109109
console.log(`User ${user.id} has an ongoing cursus in cursus ${CURSUS_ID}, allowing to take the questionnaire`);
110110
return true; // User has an ongoing cursus in the relevant cursus, allow taking the questionnaire
111111
}

0 commit comments

Comments
 (0)