Skip to content

Commit

Permalink
Tasks are not loaded for users that are not in the course (#917)
Browse files Browse the repository at this point in the history
fix(CourseRegistrationService): not throw error if user is not in course
  • Loading branch information
mxsph authored Nov 4, 2022
1 parent 28ad959 commit 2a184e3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ class CourseRegistrationService {

def getCourseRoleOfUser(cid: Int, uid: Int): Option[CourseRole.Value] = {
DB.query("SELECT course_role FROM user_course WHERE user_id = ? AND course_id = ?",
(res, _) => Option(CourseRole.parse(res.getInt("course_role"))), uid, cid).head
(res, _) => CourseRole.parse(res.getInt("course_role")), uid, cid).headOption
}
}

0 comments on commit 2a184e3

Please sign in to comment.