From b9ad882cba1f1b5aa12a3ca84c4f324ceda9ccea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20=C3=96hlerking?= Date: Tue, 10 Dec 2024 10:46:31 +0100 Subject: [PATCH] filter sub teacher --- controllers/courses.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/courses.js b/controllers/courses.js index 023a474dca..2232a344e8 100644 --- a/controllers/courses.js +++ b/controllers/courses.js @@ -322,7 +322,8 @@ const editCourseHandler = (req, res, next) => { } course.userIds = getUserIdsByRole(group.users, 'student'); - course.substitutionIds = getUserIdsByRole(group.users, 'groupSubstitutionTeacher'); + course.substitutionIds = getUserIdsByRole(group.users, 'groupSubstitutionTeacher') + .filter((subTeacherId) => !course.teacherIds.includes(subTeacherId)); if (group.validPeriod) { course.startDate = timesHelper.fromUTC(group.validPeriod.from); course.untilDate = timesHelper.fromUTC(group.validPeriod.until);